Treeview崩溃 [英] Treeview collapsing

查看:93
本文介绍了Treeview崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有一个树状视图.它每次点击都会崩溃(即每次回发刷新).我该如何处理呢?

i have a treeview in my project.it is collapsing each and every click(ie,every postback refresh).how can i handle that?

推荐答案

那里可以是处理它的多种方法.根据项目的需求/设计,您可以在服务器端或客户端进行处理.

服务器端:
跟踪所有展开的节点.回发时,根据收集的数据还原树.尽管基于性能和可用性的考虑,这是不建议的.

客户端:
您可以在使用Ajax,PageMethod等进行选择时加载子节点.按需加载"的种类-异步从服务器获取数据并填充节点.节点一旦展开,就可以切换,而无需任何服务器命中.


在codeproject中键入关键字会提供此链接,该链接可能对您有用:
ASP.NET客户端TreeView控件 [
There can be number of ways to handle it. Based on the requirement/design og the project you can handle it on server side or client side.

Server Side:
keep a track of all the node that are expanded. On postback, restore the tree based on the data gathered. Though this is not advisable based on the performance and usability grounds.

Client Side:
you can load the child node when selected using Ajax, PageMethod, etc. ''Load on demand'' sort of - get data from server asynchronously and populate the node. Once the node is expanded it can be toggled without any server hits.


Typing the keywords in codeproject gave this link, that can be useful for you:
ASP.NET Client side TreeView Control[^]


这篇关于Treeview崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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