AspxTreeList 点击刷新问题官网解决方法

Hi,

I am populating ~1500 nodes in a tree based on a web service call that takes about 10 sec to return (no control over that). I do this on Page_Load.

protected void Page_Load(object sender, EventArgs e)
{
  if  (!Page.IsPostBack) 
  {
     LoadTree();
  }
  //other code to handle when user selects item and other postbacks

}

When i click on node to expand or collapse the entire tree disappears! I have to call LoadTree() on every Page_Load? I cannot deliver a web site that takes 10s to reload page everytime you expand a node in tree (esp. ironic since all the data is there already).

In postback I plan to load supplemental data based on users choice (another time consuming process) - tree disappears then too unless I reload!

Can I get node expand/contract to work exclusively on the client? Ideally I can get notification of node selected and use AJAX update to refresh supplemental data w/o disturbing the treelist.

I see disturbing posts that indicate my 1500 nodes of data are somehow discarded on postback - what is the workaround for that? I don't want to invent workaround for server side storage of data - can I serialize treelist to viewstate or hidden field (something I thought was automatic already) and reload from there if I have to?

Am I missing something? The documentation / samples are pretty sparse and seem to focus on loading a tree from a static XML file or an instant query of a few records from local Access database - not something I ever expect to see in real life.

Rob

Alexey M (DevExpress)

Hi

This behavior is by design. The ASPxTreeList does not persist its nodes in the ViewState. You should create nodes on every page load.
I recommend that you use some caching mechanism. For instance, you can cache data in the Session state on the server, and update it all in every 10 minutes.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值