TreeView Using Problem Highlights 1. Download Address http://msdn.microsoft.com/downloads/samples/internet/WebControls/Default.asp Download is the versions of the suffix BAT (1) Bulid. Path Bull BUL Point to the path where csc.exe is located, generates Microsoft.Web.ui.WebControls.dll. (2) Creating a empty directory WebCtrl_client / 1_0 under wwwroot. (3) Copy the file under Build / Runtime to WebCtrl_Client / 1_0. (4) Select the custom toolbox for the toolbox, add Microsoft.Web.ui.WebControls.dll. Some trouble but if you can find the suffix is the automatic installation version of MSI, directly next step (I have always used this version, hoho), by "Custom Toolbox" -> ". Net Framework Components" Add TreeView to Toolbox
2. Unable to display the version of TreeView when running, it is best to download the English version of the automatic installation version to reinstall, before installing, you should first go to add the delete program to remove the original version
3. Display format error (non-tree display) TreeView requires client browser version to IE5.5 and above, it is best to request client upgrade to IE6.0
4. Use TreeView in the framework to set the NaviGateURL, Target property, update additional Frame
5. Can't find the TREENODE class using TreeView, it is best to add Namespace: use Microsoft.Web.ui.WebControls;
6. TreeView node traversal (recursive algorithm) private void Page_Load (object sender, System.EventArgs e) {GetAllNodeText (TreeView1.Nodes);} void GetAllNodeText (TreeNodeCollection tnc) {foreach (TreeNode node in tnc) {if (node.Nodes .Count! = 0) getAllNodeText (Node.Nodes); Response.Write (Node.Text ");}}
7. Get the parent of the Node Node Treenode PNode; if (node.parent is treenode) pnode = (Treenode) node.parent; else // node is root node
8. Modify TreeView pattern (example)
9. When expanded, change the autopostback when it is changed when changing the selection node; add
and write in PageLoad: string stratreename =" TreeView1 "; string strref = Page .GetPostBackeventReference (TreeView1); string strscript = "