Implement Tree Menu with TreeView
Author: Wawe Time: 2002-9-28 Recommended Level: ★ View author information and author anthology
Author: Herd specific method is: Create a database design tree information table S_Menu, contains NodeId, ParentId, NodeName, Address, Icon field, other fields may be based on actual business, the name of the node NodeName The node in the tree control Displayed, the NodeID field saves the unique identification number of the node, and the ParentID represents the parent node number of the current node, the identification number consists of a "linked list", which records the structure of the tree node. Design a web form placing the TreeView control, modify its properties ID to TVMenu.
The data structure is as follows: Create Table [DBO]. [S_MENU] ([NodeID] [char] (6) Collate Chinese_PRC_CI_AS NULL, [PARENTID] [CHAR] (6) Collate Chinese_PRC_CI_AS NULL, [NODENAME] [NVARCHAR] (50) Collate Chinese_PRC_CI_AS NULL, [Address] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL, [Icon] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL) ON [PRIMARY] GO database as follows: NodeId ParentId NodeName Address Icon100000 0 public Access unit icon_document.gif100001 100000 Daily RMB inquiry public / a1.aspx icon_settings.gif100002 100000 Currency Daily query public / a2.aspx icon_settings.gif100003 0 branch of the Ministry of Science icon_document.gif100004 100003 yuan daily queries tech / a1.aspx icon_settings.gif100005 100003 Currency Daily query tech / a2. aspx icon_settings.gif100006 0 Futian Branch icon_document.gif100007 100006 month deposit schedule a1.aspx icon_settings.gif100008 100006 month deposit charts a2.aspx icon_settings.gif100009 0 Luohu Branch icon_document.gif100010 100009 month deposit schedule a1.aspx icon_settings.gif100011 100009 Month Deposit Chart A2.ASPX Icon_Settings.gif Menu_left.aspx files are as follows: <% @ register tagprefix = "IEWC" namespace = "Microsoft.Web.ui.We bControls "Assembly =" Microsoft.Web.UI.WebControls, Version = 1.0.2.226, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 "%> <% @ Page language =" c # "Codebehind =" menu_Left.aspx.cs "AutoEventWireup =" False "inherits =" hzquery.Menu.Menu_left "%>
"http://schemas.microsoft.com/intellisense/ie5"> (Body MS_Positioning =" GridLayout ">