TreeView 代码<iewc:TreeView id="TreeView1" runat="server" TreeNodeXsltSrc="TreeNodes.xslt" TreeNodeSrc="Book.xml">
</iewc:TreeView>

解决方案 »

  1.   

    Book.xml
    <?xml version="1.0" ?>
    <Book>

    <BookTitle Title = "网站项目" >
      <Chapter NodeID="1" Title="前言"><![CDATA[1章的内容]]>
        </Chapter>
       <Chapter NodeID="2" Title="概述">2章的内容
        </Chapter>
        <Chapter NodeID="" Title="生命周期">
    <Section NodeID="31" Title = "项目定义"  >31节的内容</Section>
    <Section NodeID="32" Title = "项目评估" >32节的内容</Section>
    <Section NodeID="33" Title = "项目方案" >33节的内容</Section>
    <Section NodeID="34" Title = "项目分析" >34节的内容</Section>
    <Section NodeID="35" Title = "项目资源" >35节的内容</Section>
    <Section NodeID="36" Title = "项目控制计划" >36节的内容</Section>
       </Chapter>
       <Chapter NodeID="" Title="团队管理">
    <Section NodeID="41" Title = "团队组成" >41节的内容</Section>
    <Section NodeID="42" Title = "管理方法" >42节的内容</Section>
        </Chapter>
       </BookTitle> 
      </Book>
      

  2.   

    TreeNodes.xslt<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
    <xsl:template match="/">
    <TREENODES>
    <xsl:for-each select="Book/BookTitle">
    <xsl:element name="TreeNode">
    <xsl:attribute name="Text" ><xsl:value-of select="@Title"/></xsl:attribute>
    <xsl:attribute name="Expanded" >True</xsl:attribute>
    <xsl:attribute name="Type" >BookTitle</xsl:attribute>
    <xsl:for-each select="Chapter">
    <xsl:element name="TreeNode">
     
    <xsl:attribute name="Text" ><xsl:value-of select="@Title"/></xsl:attribute>
    <xsl:attribute name="NavigateURL" >javascript:ShowContent('<xsl:value-of select="@NodeID"/>')</xsl:attribute>
    <xsl:attribute name="Type" >Chapter</xsl:attribute>
      <xsl:for-each select="Section">
      <xsl:element name="TreeNode">
    <xsl:attribute name="Text" ><xsl:value-of select="@Title"/></xsl:attribute>
    <xsl:attribute name="NavigateURL" >javascript:ShowContent('<xsl:value-of select="@NodeID"/>')</xsl:attribute>
    <xsl:attribute name="Type" >Section</xsl:attribute>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:for-each>

    </xsl:element>
    </xsl:for-each>
    </TREENODES>
    </xsl:template>
    </xsl:stylesheet>
      

  3.   

    兄弟我找到解决方法了在treeview.htc文件中
    把函数function doNodeClick(el)
    中的
    function doNodeClick(el)
    {
        if (g_bInteractive == false)
            return;
            
        g_nodeClicked = el;    // The element, which is in a content node outside of the document, is outside the event hierarchy.
        // Fire the event ourselves, rather than relying on bubbling.
        event.cancelBubble = true;
        el.fireEvent("onclick");        // Execute our onclick handler
        element.fireEvent("onclick", event);  // Execute the tree's onclick handler    if (getNodeAttribute(el, "NavigateUrl") != null)
        {
            var target = getNodeAttribute(el, "Target");
           // if (target == null || target.toLowerCase() == "_self")
              //  return false;
        }    selectNode(el);
        return true;
    }
    这段程序品屏蔽掉
    // if (target == null || target.toLowerCase() == "_self")
              //  return false;