如何在运行时删除treeview值. [英] how to remove treeview value in run time.
本文介绍了如何在运行时删除treeview值.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码
treenode td = treeview.selectednode;
会话[" ] = td.值
当用户从树状视图中选择第二次时
我在page_load
中给出了以下代码
会话[" ] = ";
umapathi
[已删除的电话号码]
解决方案
将您要进行会话的代码粘贴到page_Load()中不是IsPostBack的内部,即
受保护的 无效 Page_Load(对象发件人,EventArgs e) { 如果(!IsPostBack){ 会话[" ] = " "; } }
在会话内部,您可以从树形视图中找到一系列选定的项目.这将很容易管理.
祝一切顺利.
--Amit
i used tree view list to list out the data.. when user select the parent node the particular value should getinto session., first time working fine. when i approach second time its giving error?
my code
treenode td=treeview.selectednode;
session["xxx"]=td.value
when user select second time from tree view
i given below code in page_load
session["xxx"]="";
umapathi
[Removed Tel Number]
解决方案
Hi,
Paste your code for session inside not IsPostBack in page_Load() i.e.
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { session["xxx"]=""; } }
Inside session you can have an array of selected items from your treeview. That will be easy to manage.
All the best.
--Amit
这篇关于如何在运行时删除treeview值.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文