Чтобы сделать вещи немного модернизированными с помощью jQuery:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:TreeView ID="TVP" runat="server">
...
</asp:TreeView>
<asp:Button ID="BTVPNC" runat="server" style="display: none;" />
</ContentTemplate>
</asp:UpdatePanel>
И код VB.NET позади:
Private Sub TVP_PreRender(sender As Object, e As EventArgs) Handles TVP.PreRender
Dim js As String = "$('#" + Me.TVP.ClientID + "').find('input[type=""checkbox""]')"
js += ".bind('change',function(){" + Me.ClientScript.GetPostBackEventReference(Me.BTVPNC, "") + ";});"
ScriptManager.RegisterStartupScript(Me.TVP, Me.TVP.GetType(), "TVP_NodeCheckAutoPostBack", js, True)
End Sub
Private Sub TVP_TreeNodeCheckChanged(sender As Object, e As TreeNodeEventArgs) Handles TVP.TreeNodeCheckChanged
'Handle your TreeView NodeChecked with AutoPostBack event here.
End Sub