Question

I'm trying to use the GRID control in the MVCContrib library with my controller. The paging control for their Grid seems to have a big limitation, it only outputs a URL as MyPage.aspx?page=2. So when I press NEXT PAGE on the control is spits out "MyPage.aspx?page=2"

My control looks like this:

    public ActionResult Index(int? page)
    {

And my routing table looks like this:

routes.MapRoute("admin", "admin/{page}", new { controller = "Admin", action = "Index", page = 1 });

For some reason my controller is not collecting the page querystring correctly. It just always appears as 1. If I send a URL such as admin/2 it works...but not when sent as admin?page=2.

What am I doing wrong?

Was it helpful?

Solution

I think you can find your answer here: ASP.NET MVC QueryString defaults overriding supplied values?

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top