views:

262

answers:

1

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?

A: 

I think you can find your answer here: http://stackoverflow.com/questions/458288/asp-net-mvc-querystring-defaults-overriding-supplied-values

Hope this helps

David E
Thank you for the link. This looks like my problem, but their code no longer works :-(
Whozumommy
Sorry for delayed response, we had a release at the end of last week. I have tried the grid control and found by having public ActionResult Index(int? page) works fine, I just needed to check that the value wasn't null (if it is use 1) otherwise use the page valueHope you have it working now
David E