动态数据 Web 应用程序未分页至第 2 页
我创建了一个动态数据 Web 应用程序,当我有多个页面时,我可以导航到第二页和最后一页,但是我无法导航到第二页和最后一页之间的任何页面... .有什么想法或建议吗?
I have created a Dynamic Data Web Application and when I have more then one page I am able to navigate to the second page and the last page however I am unable to navigate to any of the pages in between two and the last page....any ideas or suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,就我而言,这是由过滤器损坏引起的。
我创建了一个文本框过滤器,在开发过程中,为了简单起见,我无意中在 FilterControl 的
Page_Load
事件中添加了OnFilterChanged();
。后来,当我将其复制到TextChanged
事件中时,它就变得过时了,因为前一种方法存在故障。不幸的是,在List.aspx.cs中,有以下代码:
结果,在每次页面加载时,GridView的PageIndex都会被重置。由于
Page_Load
在下一页按钮的事件处理程序之前的DynamicFilter_FilterChanged
之前被调用,因此结果将是:在任何具有多个页面的列表页面上:
PageIndex
导航至第 1 页为了解决这个问题,我刚刚从过滤器中的
Page_Load
中删除了OnFilterChanged();
。您可能需要检查每个第三方过滤器。或者,您可以注释掉
DynamicFilter_FilterChanged
事件来查看过滤器是否是罪魁祸首。I encountered the same problem, and in my case, it was caused by broken filters.
I created a Textbox filter, and during development, I unwittingly added
OnFilterChanged();
in the FilterControl'sPage_Load
event for the sake of simplicity. Later, it was rendered obsolete as I copied it into theTextChanged
event, as the former method has glitches.Unfortunately, in List.aspx.cs, there lies the following code:
As a result, at every page load, the PageIndex of GridView is reset. And since
Page_Load
is called beforeDynamicFilter_FilterChanged
before the next page button's event handler, the result will be:On any list page with more than one page:
PageIndex
navigates to page 2PageIndex
navigates to page 1To solve the problem, I just removed
OnFilterChanged();
fromPage_Load
in the filter.You may need to check every third-party filter. Or, you may comment out the
DynamicFilter_FilterChanged
event to see if filters are to blame.