且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在ASP.NET MVC实现分页?

更新时间:2022-11-23 12:53:36

忽略路线仅需一分钟,你刚在URL作为查询字符串参数2不同页面的状态。

Ignoring routes for just a minute, you'll just keep the state of the 2 different pages in the URL as querystring parameters.

mysite.com/foo?list1page=2&list2page=8

mysite.com/foo?list1page=2&list2page=8

然后,你相应地构建数据/寻呼机。寻呼机链接将只更新网址

Then you build the data/pagers accordingly. The pager links will just update the url.

您可以发挥创意与途径创造更多友好的URL,但我想查询字符串PARAMS是完全可以接受的位置。

You can get creative with routes to create more friendly URLs, but I think querystring params are perfectly acceptable here.