Tree view node with parameter

salmanfazal
salmanfazal used Ask the Experts™
on
I am using a tree view to open a form in asp.net/vb.net . All the nodes open the same form but with different parameters so that form will receive the parameters and display the data as per the parameters. How to accompolish this?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fill the node in the page load with the values.

See code snippet : ( vb.net source is below C# source ).
// C#
if (!IsPostBack)
            {
                var node = new TreeNode("Pages");
 
                node.ChildNodes.Add(new TreeNode("Page A", "PageA", "", "~/page.aspx?id=1", ""));
                node.ChildNodes.Add(new TreeNode("Page B", "PageB", "", "~/page.aspx?id=2", ""));
                node.ChildNodes.Add(new TreeNode("Page C", "PageC", "", "~/page.aspx?id=3", ""));
                node.ChildNodes.Add(new TreeNode("Page D", "PageD", "", "~/page.aspx?id=4", ""));
                node.ChildNodes.Add(new TreeNode("Page E", "PageE", "", "~/page.aspx?id=5", ""));
                node.ChildNodes.Add(new TreeNode("Page F", "PageF", "", "~/page.aspx?id=6", ""));
 
                this.TreeView1.Nodes.Add(node);
            }
 
// vb.net : 
If Not IsPostBack Then
    Dim node = New TreeNode("Pages")
    
    node.ChildNodes.Add(New TreeNode("Page A", "PageA", "", "~/page.aspx?id=1", ""))
    node.ChildNodes.Add(New TreeNode("Page B", "PageB", "", "~/page.aspx?id=2", ""))
    node.ChildNodes.Add(New TreeNode("Page C", "PageC", "", "~/page.aspx?id=3", ""))
    node.ChildNodes.Add(New TreeNode("Page D", "PageD", "", "~/page.aspx?id=4", ""))
    node.ChildNodes.Add(New TreeNode("Page E", "PageE", "", "~/page.aspx?id=5", ""))
    node.ChildNodes.Add(New TreeNode("Page F", "PageF", "", "~/page.aspx?id=6", ""))
    
    Me.TreeView1.Nodes.Add(node)
End If

Open in new window

Author

Commented:
can you brief it more for vb.net part. how should i send and receive the parameters?
If you can give me an example of the parameters you want to pass .... ??

Author

Commented:
lets take this as i have a tree named directory with the nodes mentioning employee code. Once i click on employee code, it will open the form with the particular employee code information. All codes will open the same form but with different details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial