开发者

Problem with ASP.NET MVC 2 Routing

I have the following URL:

http://localhost/PagingController/ShowPage?pageNumber=3

When user clicks this link he must be redirected to the following URL:

http://localhost/MyController/ MyAction?pageNumber=3

How can I create a开发者_如何学Python mapping rule for these URLs? I don't understand how to get pageNumber parameter with URL templates such as .../{controller}/{action}

Thanks.


You don't have to define a route for it. If you use querystring, you can just get it in the action like this:

public ActionResult MyAction(int pageNumber)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜