Populating the TreeView Control from a Database 2
Creating a Simple TreeView
Lets start by creating the "Hello World" version of a TreeView. If you are coding by hand, create this new file:
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> <%@ Page Language="vb" AutoEventWireup="false" "%>
<HTML> <HEAD> <title>Simple Tree</title> </HEAD> <body> <form id="Form1" method="post" runat="server"> <iewc:TreeView id="TreeView1" runat="server"> <iewc:TreeNode Text="Parent"> <iewc:TreeNode Text="Child1"> </iewc:TreeNode> <iewc:TreeNode Text="Child2"> </iewc:TreeNode> </iewc:TreeNode> </iewc:TreeView> </form> </body> </HTML> |