How to know which tree view node on master page is clicked on the form level
-
I have a master page and there is a tree view control there and this is one of the treenodes. TreeNode _Del = new TreeNode(); _Del.Text = "Administrator"; _Del.NavigateUrl = "~\\Form1.aspx"; TreeNode _Del1 = new TreeNode(); _Del1.Text = "Manager"; _Del1.NavigateUrl = "~\\Form1.aspx"; There is a Form1 and the form1 has two panels. If treenode corresponding to _Del is clicked, panel1.visible=true, panel2.visible=false and if _Del1 is clicked, panel1.visible=false, panel2.visible=true Question: How do I get which treenode am clicking in the Form1? Is response.redirect querystring the only option? Please help and if the post is not clear, please mention. I can more clearly tell you.
Thanks
-
I have a master page and there is a tree view control there and this is one of the treenodes. TreeNode _Del = new TreeNode(); _Del.Text = "Administrator"; _Del.NavigateUrl = "~\\Form1.aspx"; TreeNode _Del1 = new TreeNode(); _Del1.Text = "Manager"; _Del1.NavigateUrl = "~\\Form1.aspx"; There is a Form1 and the form1 has two panels. If treenode corresponding to _Del is clicked, panel1.visible=true, panel2.visible=false and if _Del1 is clicked, panel1.visible=false, panel2.visible=true Question: How do I get which treenode am clicking in the Form1? Is response.redirect querystring the only option? Please help and if the post is not clear, please mention. I can more clearly tell you.
Thanks
ss.mmm wrote:
TreeNode _Del = new TreeNode(); _Del.Text = "Administrator"; _Del.NavigateUrl = "~\\Form1.aspx";
as you are navigating to the same URL, so quick fix is to add a parameter in the URL like:
_Del.NavigateUrl = "~\\Form1.aspx?node=1"; and _Del1.NavigateUrl = "~\\Form1.aspx?node=2";
and in the code you can show and hide the panels based on node.-----