ASP.NET DataPager 无法与 ListView 一起使用

发布于 2024-12-06 15:50:50 字数 481 浏览 0 评论 0原文

我在使用 DataPager 和 ListView 时遇到问题,我正在使用 ASP.NET 和 VB.NET。我一直在寻找答案,但我似乎无法让它发挥作用。每当我绑定数据时,首页都可以,尝试第二页,仍然是相同的数据,等等。然后我尝试在每次更改分页器时重新绑定数据,列表视图消失了。

关于代码:当调用UserInterface时,为了获取统计数据,它会调用DataLayer,将测试点获取到List(Of KeyValuePair(Of String,Integer)),我使用List of KeyValuePair的原因是需要基于索引的集合。然后测试点获取描述,然后 UserInterface 将其绑定

到整个相关代码,希望你 。不介意:

http://pastebin.com/stjAi9c2

我已经尝试修复它好几个小时了,希望有人能指出我正确的方向。 谢谢。

I have a problem with DataPager with ListView, I am using ASP.NET with VB.NET. I have searched for the answer, but I just can't seem to get it to work. Whenever I binded the data, the front page was okay, tried second page, still the same data, etc. Then I tried rebinding the data each time pager was changed, the listview dissapeared.

About the code: When a call is made to the UserInterface, to get statistics, it calls DataLayer, to get the test points to a List (Of KeyValuePair(Of String, Integer), reason I used List of KeyValuePair, was due to the need of index-based collection. Dictionary didn't provide it as such. Then the testpoints get the description, and number of failed test points. Then UserInterface binds it.

I put the entire related code to pastebin, hope you don't mind:

http://pastebin.com/stjAi9c2

I have been trying to fix it for many hours, hope anyone can point me in the right direction.
Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

从此见与不见 2024-12-13 15:50:50
Protected Sub ListView1_PagePropertiesChanging(ByVal sender As Object, ByVal e As     System.Web.UI.WebControls.PagePropertiesChangingEventArgs) Handles ListView1.PagePropertiesChanging

    DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false)

    userInterface.ListViewReBind(ListView1)

End Sub
Protected Sub ListView1_PagePropertiesChanging(ByVal sender As Object, ByVal e As     System.Web.UI.WebControls.PagePropertiesChangingEventArgs) Handles ListView1.PagePropertiesChanging

    DataPager1.SetPageProperties(e.StartRowIndex, e.MaximumRows, false)

    userInterface.ListViewReBind(ListView1)

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文