ERIC's infinite Tree (demo + code)

xiaoxiao2021-03-06  93

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 />

转载请注明原文地址:https://www.9cbs.com/read-123114.html

New Post(0)