Windows Develop Bookmark and Share   
 index > Windows Forms General > how to pass value from treeview selectednode
 

how to pass value from treeview selectednode

Hi all,

I had a asp file that create the treeview as follow and my page is split into 2 view - treeview and content view:

whenever I click on EqpA , it will navigate to EOW.aspx. but may I know how can I pass the selectedNode value to "EOW.aspx". In this case, if I click on EqpA, "EqpA" should be pass to EOW.aspx. Please help. Thanks

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainTreeView.aspx.cs" Inherits="MainTreeView" %>

<html>

<body>

<form id="frmReport" runat="server">

<asp:TreeView id="ReportTreeView"

runat="server">

<Nodes>

<asp:TreeNode Value="Report"

NavigateUrl="main.aspx"

Text="Report"

Target="Content"

Expanded="True">

<asp:TreeNode Value="EOW"

Text="EOW"/>

<asp:TreeNode Value="EqpA"

NavigateUrl="EOW.aspx"

Text="EqpA"

Target="Content"/>

</asp:TreeView>

</form>

</body>

</html>

bslim  Friday, December 08, 2006 7:49 AM

<asp:TreeNode Value="EqpA"

NavigateUrl="EOW.aspx?source=EqpA" <!-- Notice we have added a query param -->

Text="EqpA"

Target="Content"/>

Then in EOW.aspx use Request.Params["source"]; to retrieve the value.

Regards

GavH  Friday, December 08, 2006 11:35 AM

<asp:TreeNode Value="EqpA"

NavigateUrl="EOW.aspx?source=EqpA" <!-- Notice we have added a query param -->

Text="EqpA"

Target="Content"/>

Then in EOW.aspx use Request.Params["source"]; to retrieve the value.

Regards

GavH  Friday, December 08, 2006 11:35 AM

Hi,

Thanks for your help. I got it.

bslim  Monday, December 11, 2006 1:45 AM

You can use google to search for other answers

Custom Search

More Threads

• Clear items in a Combo box
• A Smart Client Intranet
• To refer to Textfield Item
• CurrentUICulture issue
• Set toolStripStatusLabel1 from a dialog form.
• Complex dividing interface
• How to know then the WorkArea changes.
• Need advice on Winforms HTML Controls
• DataBase
• German strings are not getting retrieved by Resourcemanager