如何保持展开/折叠状态 [英] How to maintain a state of a Expand/Collapse

查看:147
本文介绍了如何保持展开/折叠状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在菜单中使用简单的树状视图.
树视图位于母版页上,在它的旁边有容器.
用户使用树视图使用此母版页导航到其他页面.
但是在每次加载页面时,treeview节点都会折叠到原始状态.

如何维护Expand/Collapse的状态

I''m using a simple treeview for menu.
The treeview is on a masterpage, right beside it it has the container.
The user uses the treeview to navigate to otherpages using this masterpage.
But on each page load the treeview nodes are collapsed to original state.

How to maintain state of a Expand/Collapse

推荐答案

这对我们所有人来说都是一个普遍的问题.
看看链接,它将引导您正确的方向

单击此处
Its quite a common problem for all of us.
Have a look to the link, it will lead you in right direction

Click here


因为您已将页面放在在MasterPage中,每个页面在运行时都会获得自己的TreeView.因此,您无法维持状态.

解决方案1 ​​:
使用IFrame并将其他页面加载到其中.

解决方案2 :
传递Selection作为QueryString并编写代码以维护状态.
Since you have place your pages in the MasterPage, each page would get its own TreeView at run-time. So, you cannot maintain the state.

Solution 1:
Use IFrame and load the other pages into it.

Solution 2:
Pass the Selection as QueryString and write code to maintain the state.


这篇关于如何保持展开/折叠状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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