asp+微软treeview控件问题,我搜索过csdn,没找到想要的答案!
首先说明,我用的是asp,非asp.net,加载的是微软自己的treeview控件,能正确加载显示,但取不到所选节点的值。
代码如下:
<HTML>
<HEAD>
<META HTTP-EQUIV= "Content-Type " content= "text/html; charset=gb2312 ">
<TITLE> Sample Tree Control </TITLE>
<script language=javascript>
function GetSelectedNode()
{
var tvw =document.getElementById( "treeview1 "); '此句有错
var curNode = tvw.getTreeNode(tvw.selectedNodeIndex);
alert(curnode.text);
}
</script>
</HEAD>
<!--#include file= "conn.asp "-->
<BODY>
<p>
<object
classid= "CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7 " name= "treeview1 " width=374 height=428 id= "TreeView1 " >
<embed width= "374 " height= "428 "> </embed>
<param name= "_ExtentX " value= "7938 ">
<param name= "_ExtentY " value= "10583 ">
<param name= "_Version " value= "327682 ">
<param name= "LineStyle " value= "1 ">
<param name= "Style " value= "6 ">
<param name= "Appearance " value= "1 ">
</object>
</p>
<form name= "form1 " method= "post " action= " ">
<input name= "Button " type= "button " onClick= "GetSelectedNode() " value= "Button ">
</form>
<p>
<SCRIPT LANGUAGE= "VBScript ">
TreeView1.Font.Name &