页面设计
<asp:TreeView ID="LinksTreeView" Font-Names="Arial" ForeColor="Blue" OnTreeNodePopulate="PopulateNode"
runat="server" ImageSet="Arrows" OnSelectedNodeChanged="LinksTreeView_SelectedNodeChanged">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"
VerticalPadding="0px" />
<Nodes>
<asp:TreeNode Text="目录" SelectAction="Expand" PopulateOnDemand="true" />
</Nodes>
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
后台代码
public void PopulateNode(Object sender, TreeNodeEventArgs e)
{
// Call the appropriate method to populate a node at a particular level.
switch (e.Node.Depth)
{
case 0:
// Populate the first-level nodes.
PopulateProject(e.Node);
break;
case 1:
// Populate the sec