为什么#字符被添加到网址?

Mou*_*adh 5 .net c# asp.net-mvc actionlink asp.net-mvc-4

我有一个显示缩略图列表的简单页面,

我想添加一个寻呼机,我添加了两个动作链接

  <li class="ui-pagination-next">@Html.ActionLink("Next", "Paginate", "Home", new { nbSkip = ViewBag.nextSkip }, null)</li>
Run Code Online (Sandbox Code Playgroud)

当我点击我重定向到的链接时

http://localhost:41626/#/Home/Paginate?nbSkip=60
Run Code Online (Sandbox Code Playgroud)

代替

http://localhost:41626/Home/Paginate?nbSkip=60 , 
Run Code Online (Sandbox Code Playgroud)

有谁知道为什么'#'字符被添加到URL?

路线copnfig:

public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

Cur*_*urt 2

li从你的班级来看,ui-pagination-next 我假设这里使用的是 jQuery Mobile。

jQuery Mobile 默认情况下使您的链接启用 AJAX


如果您愿意,可以使用以下方法来防止这种情况发生:

$.mobile.ajaxLinksEnabled = false; 
Run Code Online (Sandbox Code Playgroud)
<script type="text/javascript">
   $(function(){
       $.mobile.ajaxLinksEnabled = false; 
   });
</script>
Run Code Online (Sandbox Code Playgroud)