Tree Management Page (code in the previous article. Because the Access database limit can only support 63 layers -_-, use SQLServer to support the 1970 layers enough, ^ _ ^)
Generated XML
Server-side TreeView used XSL
Pure client treeview for XSL
Server-side TreeView code:
<%
@ Page language = "c #" autoeventwireup = "false"
%>
<%
@ Register TagPrefix = "iewc" Namespace = "Microsoft.Web.UI.WebControls" Assembly = "Microsoft.Web.UI.WebControls, Version = 1.0.2.226, Culture = neutral, PublicKeyToken = 31bf3856ad364e35"
%>
<
HTML
>
<
HEAD
>
<
Title
>
TreeView
Title
>
<
Style
>
Body {} {font-size: 9pt; vertical-align: Top; text-align: center} Table {} {font-size: 9pt; vertical-align: top} TD {} {font-size: 9pt; vertical- Align: Top} Input {} {font-size: 9pt}
Style
>
HEAD
>
<
Body
>
<
FORM
id
= "Form1"
Method
= "POST"
Runat
= "Server"
>
<
ASP: PANEL
id
= "PNLTreeView"
Runat
= "Server"
EnableViewState
= "False"
Horizontalalign
= "Left"
Width
= "400px"
>
<
IEWC: TreeView
id
= "TV"
Runat
= "Server"
EnableViewState
= "False"
Treenodexsltsrc
= "TreeView.xsl"
Treenodesrc
= "tree.xml"
>
IEWC: TreeView
>
ASP: PANEL
>
FORM
>
Body
>
HTML
>
Client TreeView code:
<
HTML
>
<
HEAD
>
<
Title
>
TreeView Client
Title
>
<
Style
>
Body {} {font-size: 9pt; vertical-align: Top; text-align: center} Table {} {font-size: 9pt; vertical-align: top} TD {} {font-size: 9pt; vertical- Align: TOP} input {} {font-size: 9pt}
Style
>
<
Script
Language
= "JScript"
>
function placexml (spanid) {var xmlDoc = new ActiveXObject ( "Msxml2.DOMDocument"); var xslDoc = new ActiveXObject ( "Msxml2.DOMDocument"); xmlDoc.async = false; xslDoc.async = false; xmlDoc.load ( "tree .xml "); xsldoc.load (" treeworth_client.xsl "); var xhtmldoc = xmldoc.transformNode (xsldoc); document.all (spanid) .innerhtml = xhtmldoc;
Script
>
HEAD
>
<
Body
Online
= "Placexml ('spantv');"
> <
Div
id
= "PNLTreeView"
Align
= "Left"
Style
= "Width: 400px;"
>
XML: Namespace prefix = tvns /> Import namespace = tvns mailmentation = "WebCtrl_client / 1_0 / treeview.htc" /> span> div> body> html >