asp.net-mvc - jQuery Mobile、Ajax 导航和 MVC

标签 asp.net-mvc jquery-mobile

继 MVC 4 文章之后新增 Mobile Features ,我添加了 NuGet 包 jQuery.Mobile.MVC。该软件包除其他外,还会安装旧版本 1.0.3b 的 jQuery Mobile(当前版本为 1.1.0),并在 _Layout.Mobile.cshtml 中创建以下内容:

$(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), hence disabling it.
    $.mobile.ajaxEnabled = false;
});

我找不到任何文档来说明到底什么不起作用、是否有针对它的错误以及该错误的状态可能是什么。 jQuery Mobile 论坛中最接近的非古代类似提及是

http://forum.jquery.com/topic/ajax-navigation-system-is-causing-problems

在这种情况下,OP 的问题被视为“设计使然”。

所以...

为什么 Ajax 导航可能会被直接关闭,这在 jQuery Mobile 1.1.0 中仍然是一个有效的问题吗?

最佳答案

MVC 4 Beta 的问题是,如果未关闭 ajax 导航,页面导航在一次导航后就会停止工作。

这在 jQuery Mobile 1.1.0 中仍然是一个值得关注的问题。我正在使用 MVC 4 beta 和 jQuery Mobile 1.1.0,如果不禁用 ajax 导航,页面之间的导航非常不稳定。

注意:
您提到的论坛帖子与此问题无关。这篇文章是关于页面标题中的值没有更新,这是根据设计的。 (因为这是该 OP 的唯一问题,我猜他正在使用 MVC 3)


关于与您的问题相关的状态:

(...) whether there is a bug filed for it, and what the status of that bug might be (...)

我不知道...我也很想知道这一点。希望 MVC 4 正式发布时能够修复该问题。

关于asp.net-mvc - jQuery Mobile、Ajax 导航和 MVC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10232374/

相关文章:

javascript - 将值从弹出窗口 ('open' ) 发送到 'popupbeforeposition'

c# - 如何根据某些参数在构造函数中调用基构造函数?

jquery - 在页面在 jquery mobile 中完全加载之前不要隐藏加载程序

javascript - 不同的背景图片jquery mobile

jquery - 将脚本添加到 jquery mobile 中的外部页面而不是主文件

ajax - jquery mobile可折叠和galaxy tab 10.1 json响应给出随机响应

javascript - 单击按钮时 JS .click() 不起作用

c# - 将 JSON 数据对象存储到 ASP.NET MVC( Entity Framework )中的数据库

c# - Asp.net mvc 应用程序中 Layout 和局部 View 的比较

asp.net-mvc - Razor View 在升级到 Microsoft.AspNet.Mvc 版本 4.0.40804.0 后显示警告 CS1702