Why is the # character added to the URL?

I have a simple page displaying a list of thumbnails,

I want to add a pager, I added two action links

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

when i click on the link i'm redirected to

http://localhost:41626/#/Home/Paginate?nbSkip=60

instead

http://localhost:41626/Home/Paginate?nbSkip=60 , 

Does anyone know why the "#" character is added to the URL?

Copnfig route:

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 }
        );
    }
}
+5
source share
4 answers

From looking at your liclass ui-pagination-next im, jQuery Mobile is supposed to be used here.

jQuery Mobile by default makes your AJAX links enabled


If you want, you can prevent this by using:

$.mobile.ajaxLinksEnabled = false; 

<script type="text/javascript">
   $(function(){
       $.mobile.ajaxLinksEnabled = false; 
   });
</script>
+2
source

, ui-pagination-next
, - JS - ajax
hash "#" ,
, , # , JS, evet, , ,
.
- # url . - JS ajax, , , , , #, AJAX

heres indepth ,

+4

, Ajax Raw ActionLink:

@Ajax.RawActionLink("NameofLink", "Action", "Controller", new { oid = 0, type = "oid and type are 2 parameters you want to send to action " }, new { id = "btnNewB", @class = "anyclass" })
0

,

@curt, jQuery mobile, mobile.changePage

,

$.mobile.ajaxLinksEnabled = false; 

ajax. , ,

 @Html.ActionLink("Previous", "Index", new { nbSkip = ViewBag.previousSkip }, new { data_role = "button", data_icon = "arrow-l", rel = "external", data_ajax = false })

@Parv Sharma

0

All Articles