为 asp.net 的 DataList/Repeater 实现寻呼机
我有一个显示结果的 DataList 和一个应该是寻呼机的中继器。 我决定通过使用 QueryString 参数进行重定向来使用页码,因此它也可以添加书签......我的问题实际上主要在于用户界面。
如果我将 DIV 与 onclick 一起调用执行 window.location = url + pagenumber 的 JS 函数,那么我必须通过 JS 处理 QueryString 操作,这有点混乱。
如果我在 ItemTemplate 中使用 LinkButton 对象,则仅当整个 div 具有光标:指针时单击链接按钮时才会发生重定向,您知道我的意思。
对此最好的方法是什么?提前致谢。
注意:我真的很想花时间和精力来实现我自己的服务器端分页。 我认为这比阅读第三方手册更有趣。
I have a DataList showing the results, and a Repeater that is supposed to be the pager.
I decided to use the page number by redirecting with a QueryString parameter, so it will also be bookmarkable ... My problem is mainly in the UI actually.
If I put DIV's with their onclick calling a JS function that does window.location = url + pagenumber , then somehow I have to deal with QueryString operations via JS which is a bit messy.
If I use LinkButton objects within the ItemTemplate, then the Redirecting happens only when the linkbutton is clicked while whole div has cursor: pointer , you know what I mean.
What would be the best approach to this? Thanks in advance.
Note: I really want to spend the time and effort implementing my own server-side paging.
I think its more fun than reading 3rd party manuals.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
标记:
服务器端:
还有我编写的 JavaScript 查询字符串解析器:)
Markup:
Server-Side:
There is also my JavaScript querystring parser written by me :)