Click here to Skip to main content
16,003,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all..

I designed aspx page with 3 update panels and all have false visiblity

and treeview

i want to when click first node panel1.visible=true;
when click second node panel1.visible=false and panel2.visible=true;
Posted

if you have a treeview like this

XML
<asp:TreeView ID="TreeView1" runat="server"
          onselectednodechanged="TreeView1_SelectedNodeChanged">
      <Nodes>
      <asp:TreeNode Text="1" Value="1"></asp:TreeNode>
      <asp:TreeNode Text="2" Value="2"></asp:TreeNode>
      <asp:TreeNode Text="3" Value="3"></asp:TreeNode>
      </Nodes>
      </asp:TreeView>



put something like this in your code behind:

C#
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
    {
        string nodeval = TreeView1.SelectedNode.Value;
        switch (nodeval)
        {
            case "1": { UpdatePanel1.Visible = true;}
                break;
            case "2": UpdatePanel2.Visible = true;
                break;
            case "3": UpdatePanel3.Visible = true;
                break;
            default: break;
        }

    }


I think this should work
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900