We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
自己动手非常容易。 我创建了一个基于堆栈溢出分页器的简单用户控件,具有两个属性...
通过读取查询字符串确定所选页面。 最大的挑战是使用新页码更改 URL。 此方法使用查询字符串参数“p”来指定要显示的页面...
一个简单的公式来确定要显示的页码范围...
然后使用类似的内容生成每个链接(其中 min 和 max 指定范围要创建的页面链接)...
还可以创建“上一个”(和“下一个”)按钮...
第一个和最后一个按钮很简单...
在确定何时显示“...”时,显示当链接范围不在第一页或最后一页旁边时的文字控制...
对上面的“max < PageCount”执行相同的操作。
所有这些代码都放在 CreateChildControls 的重写方法中。
It's quite easy to roll your own. I created a simple user control based on the stack overflow pager with two properties...
The selected page is determined by reading the query string. The biggest challenge was altering the URL with the new page number. This method uses a query string parameter 'p' to specify which page to display...
A simple formula to determine the range of page numbers to show...
Each link then gets generated using something like (where min and max specify the range of page links to create)...
One can also create 'Previous' (and 'Next') buttons...
The first and last buttons are straight forward...
In determining when to show the "...", show a literal control when the link range is not next to the first or last pages...
Do the same for above for "max < PageCount".
All of this code is put in an override method of CreateChildControls.
我期待更多的答案,但看起来很多人只是自己做。 我发现了一个不错的,经常在 codeproject.com
它与 stackoverflow.com 的不太一样。 如果有一个像样的开源控件具有多种不同的输出选项,那就太好了。
I was expecting more answers but it looks like a lot of people just make their own. I've found a decent one that is maintained quite often on codeproject.com
It's not quite the same as the stackoverflow.com one. It'd be nice if there was a decent open source control that had a variety of different output options.
我使用过 DevExpress 和 Telerik 页面控件,并且更喜欢 DevExpress 分页器。 我不确定 DevExpress 寻呼机是否可以直接使用查询字符串,但如果不能,我会感到惊讶,因为它非常灵活。 至于下载后现有页面之间的分页,所有内容都可以驻留在客户端上,或者如果需要访问服务器,则该控件完全配备 AJAX。 我建议您从 www.devexpress.com 开始搜索,然后也查看 www.Telerik.com(也配备了 AJAX)。
I've worked with the DevExpress and Telerik page controls and prefer the DevExpress pager. I'm not sure if the DevExpress pager can work directly with a querystring but I would be surprised if it didn't as it is very flexible. As far as paging between existing pages after download, everything can reside on the client or, if a trip to the server is necessary, the control is fully AJAX equipped. I suggest you start your search at www.devexpress.com and then check out www.Telerik.com as well (which is also AJAX equipped).
不是控件,但这是在数据库级别实现分页的方法: SQL Server 2005 分页
Not a control, but this is the way to implement paging at the DB level: SQL Server 2005 Paging
我编写了一个寻呼机控件,名为:Flexy Pager
了解更多: http://www.codeproject .com/Articles/748270/Flexy-Pager-for-ASP-NET-WebForm-MVC
I have written a pager control named: Flexy Pager
Read more: http://www.codeproject.com/Articles/748270/Flexy-Pager-for-ASP-NET-WebForm-MVC
您可以尝试 NPager。 使用页面索引的查询字符串,无回发。 需要 Bootstrap 进行样式设置,但是您可以使用“分页”CSS 类为控件拥有自己的自定义 css 类。这是一个有效的 演示
You can try NPager. Uses query string for page indexes, no postbacks. Needs Bootstrap for styling, however you can have your own custom css classes for the control using 'pagination' CSS class.Here is a working DEMO