类似 MSDN 导航树效果 ASP.Net(C#) + JavaScript 实现! (转)

类似 MSDN 导航树效果 ASP.Net(C#) + JavaScript 实现! (转)[@more@]

测试站点:
do.NET/tree/webFORM1.ASPx">http://www.triaton.com.cn/../dotnet/tree/WebFORM1.aspx

虽然号称 .net 了!
但实际还是传统 CGI、ASP 的思想,没有使用Codebehind="WebFORM1.aspx.cs",仍然采取了 B/S 混合(HTML/C#)脚本的方式:


A href="tag-88-1.html">w3c//DTD HTML 4.0 Transitional//EN" >


WebFORM1
microsoft Visual Studio 7.0">

Javascript">
intellisense/ IE5">


RM id="FORM1" method="post" runat="server">







System.Data.Oledb.OleDbConnection oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
oleDbConnection1.ConnectionString =@"Provider=sqlOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Test;Data source=TRIATONPSQL2KE";
oleDbConnection1.ConnectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/dvbbs") + @"Tree.mdb;Persist Security Info=False";
oleDbConnection1.Open();
System.Data.OleDb.OleDbCommand OleDbCommand1 = new System.Data.OleDb.OleDbCommand("select *,(select count(*) from tree where parentid = T.id) as children from tree T where rootid = id",oleDbConnection1) ;
System.Data.OleDb.OleDbDataReader OleDbDataReader1 = OleDbCommand1.ExecuteReader();
int i = 0;
while (OleDbDataReader1.Read())
{
 %>

       正在加载 ...
   
               
          i++;
}

%>

















WebFORM2


Javascript">






string ParentNode;
ParentNode = Request.QueryString["pnode"];
//Response.Write(ParentNode.Replace("_",""));
int i;
int j;
string nSpace="";
j= ParentNode.Length - ParentNode.Replace("_","").Length;
for (i=0;i    nSpace = nSpace + "    ";
string sHTML ="";
i=0;
       System.Data.OleDb.OleDbConnection oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
oleDbConnection1.ConnectionString =@"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Test;Data Source=TRIATONPSQL2KE";
oleDbConnection1.ConnectionString =@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/dvbbs") + @"Tree.mdb;Persist Security Info=False";
oleDbConnection1.Open();
System.Data.OleDb.OleDbCommand OleDbCommand1 = new System.Data.OleDb.OleDbCommand("select *,(select count(*) from tree where parentid =T.id ) as Children from tree T where parentid = " + Request.QueryString["PID"],oleDbConnection1) ;
System.Data.OleDb.OleDbDataReader OleDbDataReader1 = OleDbCommand1.ExecuteReader();
while (OleDbDataReader1.Read())
{
    sHTML = sHTML + " ";
           if (System.Convert.ToInt64(OleDbDataReader1["children"])>0)
              sHTML = sHTML + "
" + nSpace + "  正在加载 ...
";
            i++;
}
Response.Write(sHTML);
%>



 


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-998325/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10748419/viewspace-998325/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值