TreeView大資料量綁定的最佳化方案(the Plenty of data issue of ASP.NET TreeView)

來源:互聯網
上載者:User
In that scenario, I have some suggestions:
 
First, please try to keep the node number of TreeView less than 1000, we can find that advice there:
 

http://msdn.microsoft.com/en-us/library/ms529261.aspx
Rendering enormous hierarchical data sets in a single TreeView data island is not recommended. As a general rule, try to keep the number of nodes in a tree under 1000.
 
Each time an update is made to the UI of a TreeView control, for example, whenever a node is expanded or collapsed, additional data is appended to the view state, which maintains a history of state changes in the Web page. This means that each time a view is updated with a large data island, the amount of data appended to the view state history is increased. In ASP.NET, there is a limit in the size of the view state, so the combination of very large tree hierarchies combined with multiple updates may cause performance problems, and in certain cases portions of the history could be lost.

 
 
Second, if the rendered page is too large, I would like to suggest you try the ASP.NET 2.0 CSS Friendly Control Adapters, just like the following picture shows, it can optimize the rendering of the TreeView control:


 
 
Third, we can use AJAX to bind the Tree Node dynamically on demand; I think it can resolve the Plenty of data issue of TreeView:
 
 
There are some good article and samples about AJAX TreeView:
 
Building Tree View on demand using AJAX
http://www.codeproject.com/KB/aspnet/TreeViewAjax.aspx
 
Ajax TreeView
http://codeclimber.net.nz/archive/2007/06/28/Ajax-TreeView.aspx
 
Treeview AJAX Control sample page
http://www.mathertel.de/AJAXEngine/S03_AJAXControls/TreeView.aspx
 
DHTML Tree View of Arbitrary Depth using AJAX
http://www.codeproject.com/KB/aspnet/ajax_treeview.aspx
 
If I’ve misunderstood the facing issue, please feel free to let me know.
 
Thanks.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.