I was made paging system. Everything is OK.
After click 2nd page all homepage links changing.
@Html.ActionLink("Home page", "Index", "Home") //This is standard routing without values.
I was added paging links to end of page.
@Html.ActionLink("2", "Index", "Home", New With {.id = 2}, Nothing) //This works good too.
My problem is when I click to 2nd or more page (e.g : http://www.site.com/Home/Index/2) my all homepage links converting to
<a href="/Home/Index/2">Home page</a>
same this.
How I can resolve this problem?
When you click on the 2nd page the
{.id = 2}will be part of your RouteData. And because your routing probably looks like this: (in Gloabal.asax)ASP.NET MVC will use this route for the generated links. So it will include Id = 2. To fix this you need to explicitly override it when it’s not needed: