?Selected node changed
- by user175084
I have a tree view like this and i want to navigate to 3 different pages using response .redirect
--machine groups (main)
----dept (Parent)
------xyz (child)
protected void TreeView2_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView2.SelectedValue == "Machine Groups")
{
Response.Redirect("~/Gridviewpage.aspx");
}
else
switch (e.Node.Depth)
{
case 0:
Response.Redirect("~/Machineupdate.aspx?node=" + TreeView2.SelectedNode.Value);
break;
case 1:
Response.Redirect("~/MachineUpdatechild.aspx?node=" + TreeView3.SelectedNode.Value);
break;
}
}
}
now if i put EventArgs it points to an error on e.Node that system.EventArgs does not contain definition for Node.
If i replace EventArgs with TreeNodeEventArgs then that error goes but i get an error on compilation.
Compiler Error Message: CS0123: No overload for 'TreeView2_SelectedNodeChanged' matches delegate 'System.EventHandler'
<asp:TreeView ID="TreeView2" runat="server" OnUnload="TreeViewMain_Unload"
ontreenodepopulate="TreeView2_TreeNodePopulate"
onselectednodechanged="TreeView2_SelectedNodeChanged">
<Nodes>
<asp:TreeNode PopulateOnDemand="True" Text="Machine Groups"
Value="Machine Groups"></asp:TreeNode>
</Nodes>
</asp:TreeView>
Please help me out....
I would also like to kno what is the diff between EventArgs and TreeNodeEventArgs
Thanks