<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="IEControls"
Namespace="Microsoft.Web.UI.WebControls"
Assembly ="Microsoft.Web.UI.WebControls"
%>
<script runat=server>
Sub Node_Collapse(ByVal Sender as Object, _
ByVal E as TreeViewClickEventArgs)
lblMessage.Text = "You collapse node " _
& E.Node.ToString() & "."
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Writing Code that Fires When a TreeNode Collapses</TITLE>
</HEAD>
<BODY LEFTMARGIN="40">
<form runat="server">
<IEControls:treeview
id="tvBasic"
oncollapse="Node_Collapse"
autopostback="True"
runat="server">
<IEControls:treenode Text="Clothing">
<IEControls:treenode Text="Men's"/>
<IEControls:treenode Text="Women's"/>
<IEControls:treenode Text="Children's">
<IEControls:treenode Text="Socks"/>
<IEControls:treenode Text="Shirts"/>
<IEControls:treenode Text="Pants"/>
</IEControls:treenode>
</IEControls:treenode>
<IEControls:treenode Text="Electronics">
<IEControls:treenode Text="TV/VCR"/>
<IEControls:treenode Text="Audio"/>
<IEControls:treenode Text="Car"/>
<IEControls:treenode Text="Computer"/>
</IEControls:treenode>
</IEControls:treeview>
<BR>
<asp:Label
id="lblMessage"
runat="server"
FOnt-Bold="True"
/>
</form>
</BODY>
</HTML>
|