如何在ASP.NET中使用树视图中的分页 [英] How to use paging in treeview in ASP.NET

查看:79
本文介绍了如何在ASP.NET中使用树视图中的分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我在我的项目中使用treeview从数据库加载数据。

由于数据很多,因此页面需要花时间加载。

有没有办法在TreeView中使用分页?



或者是否有任何方法可以在页面加载中加载初始数据并进行休息和休息在后台加载所以页面应该加载快... ???



我尝试过:



目前我是装载所有数据页面加载

Hi friends,
I am using treeview in my project to load data from database.
As data is to much in that case page take time to load.
Is there any way to use paging in TreeView??

Or is there any way to load innitial data on page load in beging and rest load in background so page should be load fast...???

What I have tried:

currently i am lading all data on page load

推荐答案

也许你可以在TreeView控件下放一些超链接,超链接有网址如

Perhaps you can put some Hyperlinks under the TreeView control, the Hyperlinks has the URL like
<a id="hyperlink1" href="?page=1" runat="server">page 1</a>



应将Hyperlink动态添加到占位符控件中。并根据不同的查询

字符串页面,您可以使用不同的数据填充TreeView控件。



这是一个Microsoft Web资源,介绍TreeView控件,请参考下面的URL。

http://msdn.microsoft.com/en-us/library/e8z5184w(VS.80).aspx

,
the Hyperlink should be dynamically added to a placeholder control. And according to the different query
string page, you can populate the TreeView control with different data.

Here is a Microsoft web resource which introduces the TreeView control, please refer to the URL below.
http://msdn.microsoft.com/en-us/library/e8z5184w(VS.80).aspx


我也遇到过同样的问题。然后我做的是,第一次保持所有节点关闭,只查询SQL需要显示的根节点,在点击特定节点后,我查询该节点ID并流行其子节点。简而言之,我通过使用父节点ID在单击父节点时从数据库加载子节点。



希望它对您有所帮助,请不要忘记标记我的好评。谢谢:))
I have also experience same issue. Then what I do was, for the very first time keep all nodes close and only query to SQL for root nodes that needs to be display, after wards when click on particular node, I make query for that node ID and popular its child nodes. In short, I was loading child nodes from database, on clicking on parent node, by using parent node ID.

Hope it will helpful for you, please don't forget to mark my good rating. Thanks :)


这篇关于如何在ASP.NET中使用树视图中的分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆