ASP.NET Programming Technology - Implement Tree Menu with TreeView
The specific method is: Create a database, design a tree graph information table S_Menu, contain NodeID, ParentID, NodeName, Address, ICON field, and other fields depending on the actual business, the node name NodeName will display on the node of the tree control, NodeID field Save the unique identification number of the node, ParentID indicates the parent node number of the current node, and the identification number consists of a "linked list" to record the structure of the node on the tree. 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 Icon 100000 0 Department of Public inquiries icon_document.gif 100001 100000 Renmin Bi Daily query public / a1.aspx icon_settings.gif 100002 100000 Currency Daily query public / a2.aspx icon_settings.gif 100003 0 Branch of the Ministry of Science icon_document.gif 100004 100003 RMB daily query tech / a1.aspx icon_settings.gif 100005 100003 foreign currency daily query tech / a2.aspx icon_settings.gif 100006 0 Futian branch icon_document.gif 100007 100006 deposit schedule a1.aspx icon_settings.gif 100008 100006 month deposit trend Figure A2.ASPX ICON_SETTINGS.GIF 100009 0 Luohu Branch icon_Document.gif 100010 100009 month Deposit Schedule A1.ASPX Icon_Settings.gif 100011 100009 month Deposit Chart A2.ASPX Icon_Settings.gif Menu_left.aspx file as follows: <% @regiTer tagprefix = "IEWC" Namespace = "Microsoft.Web.ui.WebControls" 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 "%>