探讨有关treeview的实现问题 seehttp://www.xtreeme.com/sitexpert/styles/index.php 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我最近自己写的,目前只有3层,后台是xml和access,html componenthttp://www24.brinkster.com/genie517/Products/menu.html 我想用xml,c#怎么实现啊? 下面是用javascript实现的树:希望对你有所帮助<%@LANGUAGE="VBSCRIPT"%><!--#include file="Connections/hi.asp" --><%set Recordset2 = Server.CreateObject("ADODB.Recordset")Recordset2.ActiveConnection = MM_hi_STRINGRecordset2.Source = "SELECT * FROM sxlt"Recordset2.CursorType = 0Recordset2.CursorLocation = 2Recordset2.LockType = 3Recordset2.Open()Recordset2_numRows = 0%><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link rel="stylesheet" href="shu.css" type="text/css"></head><body bgcolor="#FFFFFF" text="#000000" class="unnamed1"><script language="JavaScript">NS4 = (document.layers) ? 1 : 0;IE4 = (document.all) ? 1 : 0;ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) { with (document) { write("<STYLE TYPE='text/css'>"); if (NS4) { write(".parent {position:absolute; visibility:visible}"); write(".child {position:absolute; visibility:visible}"); write(".regular {position:absolute; visibility:visible}") } else { write(".child {display:none}") } write("</STYLE>"); }}function getIndex(el) { ind = null; for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id == el) { ind = i; break; } } return ind;}function arrange() { nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height; for (i=firstInd+1; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.visibility != "hide") { whichEl.pageY = nextY; nextY += whichEl.document.height; } }}function initIt(){ if (!ver4) return; if (NS4) { for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide"; } arrange(); } else { divColl = document.all.tags("DIV"); for (i=0; i<divColl.length; i++) { whichEl = divColl(i); if (whichEl.className == "child") whichEl.style.display = "none"; } }}function expandIt(el) { if (!ver4) return; if (IE4) { whichEl = eval(el + "Child"); if (whichEl.style.display == "none") { whichEl.style.display = "block"; } else { whichEl.style.display = "none"; } } else { whichEl = eval("document." + el + "Child"); if (whichEl.visibility == "hide") { whichEl.visibility = "show"; } else { whichEl.visibility = "hide"; } arrange(); }}onload = initIt;</script><% DO While NOT Recordset2.EOFiidd = (Recordset2.Fields.Item("sxltid").Value)%><div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Parent" class="parent"><a href="#" onClick="expandIt('KB<%=(Recordset2.Fields.Item("sxltid").Value)%>'); return false" ><img src="pic/plus.gif" border=0 width="35" height="17"><%=(Recordset2.Fields.Item("sxltsubject").Value)%></a></div><div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Child" class="child"> <%set Recordset1 = Server.CreateObject("ADODB.Recordset")Recordset1.ActiveConnection = MM_hi_STRINGRecordset1.Source = "SELECT * FROM sxb WHERE sxfatherid = "& iidd &""Recordset1.CursorType = 0Recordset1.CursorLocation = 2Recordset1.LockType = 3Recordset1.Open()Recordset1_numRows = 0DO While NOT Recordset1.EOFresponse.write "<a href='default.asp?sxid="& Recordset1.Fields.Item("sxid").Value &"' target='_blank' ><img src='pic/spacer.gif' border=0 alt='' width='15' height='11'><img src='pic/open.gif' border='0' width='32' height='18'>"& Recordset1.Fields.Item("sxsubject").Value &"</a><br>"Recordset1.MoveNext()loop%></div> <%Recordset2.MoveNext()loop%></body></html><%Recordset1.Close()%><%Recordset2.Close()%> 我把微软的TreeView给写出来了!行不行?要源码的话!说一声! qieyj(温馨港湾) 精神可嘉,都给你了。 问了N个.NET高手都说看不懂的代码!哪位能帮我解释一下! IIS 5.1 的问题? 水晶报表 在SDK2.0中怎么调出类浏览器?? 怎样在页面和页面的用户控件进行交互 !~请教 高手请进,高分相增!!!!一个有关iis的问题 如何隐藏框架内页面的按钮 谁能告诉我这段代码有什么问题! datagrid中用属性生成器生成的"修改"按钮,如何编写对应的处理方法? DataFormatString="{0:yyyy年MM月dd日 hh:mm}" asp.net高级编程中的IBuyAdventure.net例子问题? datalist的datakeyfield怎么绑定啊?
http://www24.brinkster.com/genie517/Products/menu.html
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/hi.asp" -->
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_hi_STRING
Recordset2.Source = "SELECT * FROM sxlt"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
Recordset2_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="shu.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" class="unnamed1">
<script language="JavaScript">
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;if (ver4) {
with (document) {
write("<STYLE TYPE='text/css'>");
if (NS4) {
write(".parent {position:absolute; visibility:visible}");
write(".child {position:absolute; visibility:visible}");
write(".regular {position:absolute; visibility:visible}")
}
else {
write(".child {display:none}")
}
write("</STYLE>");
}
}function getIndex(el) {
ind = null;
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id == el) {
ind = i;
break;
}
}
return ind;
}function arrange() {
nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height;
for (i=firstInd+1; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.visibility != "hide") {
whichEl.pageY = nextY;
nextY += whichEl.document.height;
}
}
}function initIt(){
if (!ver4) return;
if (NS4) {
for (i=0; i<document.layers.length; i++) {
whichEl = document.layers[i];
if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
}
arrange();
}
else {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
whichEl = divColl(i);
if (whichEl.className == "child") whichEl.style.display = "none";
}
}
}function expandIt(el) {
if (!ver4) return;
if (IE4) {
whichEl = eval(el + "Child");
if (whichEl.style.display == "none") {
whichEl.style.display = "block";
}
else {
whichEl.style.display = "none";
}
}
else {
whichEl = eval("document." + el + "Child");
if (whichEl.visibility == "hide") {
whichEl.visibility = "show";
}
else {
whichEl.visibility = "hide";
}
arrange();
}
}
onload = initIt;
</script>
<%
DO While NOT Recordset2.EOF
iidd = (Recordset2.Fields.Item("sxltid").Value)
%>
<div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Parent" class="parent"><a href="#" onClick="expandIt('KB<%=(Recordset2.Fields.Item("sxltid").Value)%>'); return false" ><img src="pic/plus.gif" border=0 width="35" height="17"><%=(Recordset2.Fields.Item("sxltsubject").Value)%></a></div>
<div id="KB<%=(Recordset2.Fields.Item("sxltid").Value)%>Child" class="child">
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_hi_STRING
Recordset1.Source = "SELECT * FROM sxb WHERE sxfatherid = "& iidd &""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
DO While NOT Recordset1.EOF
response.write "<a href='default.asp?sxid="& Recordset1.Fields.Item("sxid").Value &"' target='_blank' ><img src='pic/spacer.gif' border=0 alt='' width='15' height='11'><img src='pic/open.gif' border='0' width='32' height='18'>"& Recordset1.Fields.Item("sxsubject").Value &"</a><br>"
Recordset1.MoveNext()
loop
%>
</div>
<%
Recordset2.MoveNext()
loop
%>
</body>
</html>
<%
Recordset1.Close()
%>
<%
Recordset2.Close()
%>