使用动态创建的html表进行分页
我正在为网站的在线销售进行编码.我要显示产品的主页上有一个问题.我定义了一个包含4列的表格,但是有100多种产品,因此需要分页.
I am coding online sales for a website. I have a problem on my main page where I would like to show products. I defined a table with 4 columns, but there are over than a 100 products and I need paging for that.
如何实现每页20个产品的分页?
How can I implement paging with 20 products per page?
There are a lot of finished controls that will help you on the way, check this MSDN Article out: Creating a Pager Control for ASP.NET
您还可以查看众多jQuery Pagers中的一个,但是,如果您使用jQuery解决方案,则所有行将始终被加载.如果对它使用一些预构建的ASP.NET控件,它将仅获取每个页面所需的元素数.
You could also check out one of the many jQuery Pagers out there, however if you use the jQuery solution all the rows will always be loaded. If you use some pre-built ASP.NET control for it, it will only fetch the number of elements you desire for each page.