Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to know which tree view node on master page is clicked on the form level

How to know which tree view node on master page is clicked on the form level

Scheduled Pinned Locked Moved C#
questiondata-structureshelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ss mmm
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • S ss mmm

      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

      S Offline
      S Offline
      SABhatti
      wrote on last edited by
      #2

      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.

      -----

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups