Nepethya Rana

Nepethya Rana

  • NA
  • 335
  • 151.6k

Event does not wire up in aspx page

Nov 20 2017 9:20 AM
I have dynamically created Tree Node and child nodes in my asp.net web application.
I haved added SelectedNodeChanged event via properties on my child nodes. I run my application but the event did not fire. When i looked back
I could see that changed event has been added in aspx file.

aspx page with page directive Codebehind="Default.aspx.vb"
<table>
<tr>
<td>
<asp:Panel ID="pnlSample" Height="450px" width="550px" BorderStyle=Solid BorderColor=black BorderWidth=1px runat="server" ScrollBars=Vertical>
<asp:TreeView ID="SampleTreeView" runat="server"></asp:TreeView>
</asp:Panel>
</td>
</tr>
</table>
Code Behind:
Protected Sub SampleTreeView_SelectedNodeChanged(sender As Object, e As EventArgs) Handles SampleTreeView.SelectedNodeChanged

Dim filePath As String = SampleTreeView.SelectedValue

// Some code

End Sub

Answers (3)