TreeView 代码<iewc:TreeView id="TreeView1" runat="server" TreeNodeXsltSrc="TreeNodes.xslt" TreeNodeSrc="Book.xml">
</iewc:TreeView>
</iewc:TreeView>
解决方案 »
- asp.net 疑问
- ajax仿google搜索,数据显示不出来,请高手
- 紧急问题,帮忙啊,在线等。
- datalist中的在同一个组中的radiobutton能够实现单选点击,但是后代取不到值,求解决。。
- asp与asp.net 兼容问题,以及ASP.NET配置问题 高分(100) 在线等待
- 把数据库中一行的数据纵向显示,用什么方法?
- 怎么把一个字符串类型的变量转化为http地址。(在线等待)
- 问一个简单问题,如何取得字符串的前两个字符?
- 怎么给TreeView 加事件来实现被选择项,直接获取到值;急急,在线等
- DataGrid的动态分页问题,用PageSize="<%# %>"为何有时可以有时不行???
- 谁能推荐一个基于.Net的工作流引擎?
- 求一asp.net C#版本冒泡排序的例子!
<?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>
<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>
把函数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;