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"
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
Dim filePath As String = SampleTreeView.SelectedValue
// Some code
End Sub

Nilesh ShahRank #42 · 34.2K reputationPosted Nov 20, 2017, 5:01 AM EST
Nilesh ShahRank #42 · 34.2K reputationPosted Nov 20, 2017, 6:33 AM EST
Nepethya RanaRank #4,361 · 348 reputationPosted Nov 20, 2017, 6:51 AM EST
Try
Dim filePath As String = SampleTreeView.SelectedValue
Response.ContentType = "application/pdf"
Response.AddHeader("Content-Disposition", [String].Format("attachment;filename=""{0}""", filePath))
Response.TransmitFile(filePath)
Response.Flush()
Else
HttpContext.Current.Response.StatusCode = 404
HttpContext.Current.Response.Flush()
End If
Catch ex As Exception
HttpContext.Current.Response.StatusCode = 404
HttpContext.Current.Response.Flush()
Throw
End Try
End Sub