我正在使用ASP.NET MVC 4移動應用程序,其中我嘗試重定向到外部網站。然而,它以「錯誤加載頁面」消息失敗。在ASP.NET MVC 4中的URL重定向移動應用程序
public void RedirectToGoogle()
{
Response.Redirect("http://www.google.com");
}
我也看到_Layout.cshtml以下腳本,它是在創建應用程序自動創建。
<script>
$(document).bind("mobileinit", function() {
// As of Beta 2, jQuery Mobile's Ajax navigation does not work in all cases (e.g.,
// when navigating from a mobile to a non-mobile page, or when clicking "back"
// after a form post), hence disabling it.
$.mobile.ajaxEnabled = false;
});
</script>
我試着改變$ .mobile.ajaxEnabled爲true,但沒有成功。
有關如何在ASP.NET MVC 4 Mobile應用程序中進行url重定向的任何想法?
什麼是解決方案?我收到以下錯誤:SEC7118:XMLHttpRequest需要https://docs.google.com/spreadsheets/d/1KcdPEYjmvemndMfJv3IAIK5HAX2xs267mvtt6WHGkC8/edit?usp=sharing所需的跨源資源共享(CORS)。 SEC7119:https://docs.google.com/spreadsheets/d/1KcdPEYjmvemndMfJv3IAIK5HAX2xs267mvtt6WHGkC8/edit?usp=sharing所需的XMLHttpRequest需要CORS預檢。在Access-Control-Allow-Origin標題中找不到SEC7120:Origin http:// localhost:18591。 SCRIPT7002:XMLHttpRequest:網絡錯誤0x80070005,訪問被拒絕。 – AKS 2014-09-24 11:15:43