jQuery Mobile的使用MVC链接 [英] JQuery Mobile Links with MVC
问题描述
我设立一个jQuery移动网站的ASP.NET MVC 3和剃刀UI。我生成像我的链接:
I'm setting up a JQuery mobile site with ASP.NET MVC 3 and the Razor UI. I'm generating my links like:
<a href='@Url.Action("View", "Users", new { Group = 2 })' data-role="button">See Group 2</a>
说我是从家庭/索引访问它。我遇到的问题是,当我点击链接,它的作用:
Say I'm accessing it from Home/Index. The issue I'm having is when I click on the link, it does:
的http://本地主机/ MyApp的/首页/索引#的myapp /用户/视图
我也试过直接帮手 @ Html.ActionLink(查看,用户,...)
和我得到的URL的同一个问题,并且它导致该应用程序中断。把一个/前链路是雪上加霜。任何想法?
I also tried the direct helper @Html.ActionLink("View", "Users", ...)
and I'm getting the same issue with the URL's, and it's causing the application to break. Putting a / before the link is worse. Any ideas?
感谢。
推荐答案
每链接,你可以这样做:
设置的rel =外部
属性,或设置任何目标
属性。
Set a rel=external
attribute, or set any target
attribute.
在全球范围内,你可以这样做:
$(window.document).bind("mobileinit", function() {
$.mobile.ajaxEnabled = false;
$.mobile.hashListeningEnabled = false;
});
这篇关于jQuery Mobile的使用MVC链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!