【小山】ASP.NET2.0 TreeView

iDotNetSpace發表於2008-07-08
待續
1.html程式碼
【小山】ASP.NET2.0 TreeView<html xmlns="http://www.w3.org/1999/xhtml" >
【小山】ASP.NET2.0 TreeView
<head runat="server">
【小山】ASP.NET2.0 TreeView    
<title>Untitled Pagetitle>
【小山】ASP.NET2.0 TreeView    
<script language="javascript">
【小山】ASP.NET2.0 TreeView        
function chkAll()
【小山】ASP.NET2.0 TreeView        
{
【小山】ASP.NET2.0 TreeView            
//debugger;
【小山】ASP.NET2.0 TreeView
            var chkall= document.all["chkall"];
【小山】ASP.NET2.0 TreeView            
var chkother= document.getElementsByTagName("input");
【小山】ASP.NET2.0 TreeView            
for (var i=0;i<chkother.length;i++)
【小山】ASP.NET2.0 TreeView            
{
【小山】ASP.NET2.0 TreeView                
if( chkother[i].type=='checkbox')
【小山】ASP.NET2.0 TreeView                
{
【小山】ASP.NET2.0 TreeView                    
if(chkother[i].id.indexOf('TreeView1')>-1)
【小山】ASP.NET2.0 TreeView                    
{
【小山】ASP.NET2.0 TreeView                        
if(chkall.checked==true)
【小山】ASP.NET2.0 TreeView                        
{
【小山】ASP.NET2.0 TreeView                            chkother[i].checked
=true;
【小山】ASP.NET2.0 TreeView                        }

【小山】ASP.NET2.0 TreeView                        
else
【小山】ASP.NET2.0 TreeView                        
{
【小山】ASP.NET2.0 TreeView                            chkother[i].checked
=false;
【小山】ASP.NET2.0 TreeView                        }

【小山】ASP.NET2.0 TreeView                    }

【小山】ASP.NET2.0 TreeView                }

【小山】ASP.NET2.0 TreeView            }

【小山】ASP.NET2.0 TreeView        }

【小山】ASP.NET2.0 TreeView    
script>
【小山】ASP.NET2.0 TreeView
head>
【小山】ASP.NET2.0 TreeView
<body>
【小山】ASP.NET2.0 TreeView    
<form id="form1" runat="server">
【小山】ASP.NET2.0 TreeView         
<table width=100% height=100%>
【小山】ASP.NET2.0 TreeView            
<tr height=10>
【小山】ASP.NET2.0 TreeView                
<td><input id="chkall" type="checkbox" onclick="chkAll();" />全選/取消td>
【小山】ASP.NET2.0 TreeView                
<td><asp:Button ID="Button1" runat="server" Text="Button" />td>
【小山】ASP.NET2.0 TreeView            
tr>
【小山】ASP.NET2.0 TreeView            
<tr valign=top>
【小山】ASP.NET2.0 TreeView                
<td><asp:TreeView ID="TreeView1" runat="server" >asp:TreeView>td>
【小山】ASP.NET2.0 TreeView                
<td><iframe id=fMain style="BORDER-TOP-STYLE.: none; BORDER-RIGHT-STYLE.: none; BORDER-LEFT-STYLE.: none; BORDER-BOTTOM-STYLE.: none"
【小山】ASP.NET2.0 TreeView                            src
="" frameBorder="0" width="100%" scrolling="yes" height="100%">iframe>td>
【小山】ASP.NET2.0 TreeView            
tr>
【小山】ASP.NET2.0 TreeView            
<tr height=10>
【小山】ASP.NET2.0 TreeView                
<td>td>
【小山】ASP.NET2.0 TreeView            
tr>
【小山】ASP.NET2.0 TreeView        
table>
【小山】ASP.NET2.0 TreeView
【小山】ASP.NET2.0 TreeView    
form>
【小山】ASP.NET2.0 TreeView
body>
【小山】ASP.NET2.0 TreeView
html>
【小山】ASP.NET2.0 TreeView
2.cs程式碼
【小山】ASP.NET2.0 TreeViewusing System;
【小山】ASP.NET2.0 TreeView
using System.Data;
【小山】ASP.NET2.0 TreeView
using System.Configuration;
【小山】ASP.NET2.0 TreeView
using System.Collections;
【小山】ASP.NET2.0 TreeView
using System.Web;
【小山】ASP.NET2.0 TreeView
using System.Web.Security;
【小山】ASP.NET2.0 TreeView
using System.Web.UI;
【小山】ASP.NET2.0 TreeView
using System.Web.UI.WebControls;
【小山】ASP.NET2.0 TreeView
using System.Web.UI.WebControls.WebParts;
【小山】ASP.NET2.0 TreeView
using System.Web.UI.HtmlControls;
【小山】ASP.NET2.0 TreeView
using System.Data.SqlClient;
【小山】ASP.NET2.0 TreeView
【小山】ASP.NET2.0 TreeView
public partial class Page_Wonderful_TreeView_System.Web.UI.Page
【小山】ASP.NET2.0 TreeView
{
【小山】ASP.NET2.0 TreeView    
protected void Page_Load(object sender, EventArgs e)
【小山】ASP.NET2.0 TreeView    
{
【小山】ASP.NET2.0 TreeView        
if (!Page.IsPostBack)
【小山】ASP.NET2.0 TreeView        
{
【小山】ASP.NET2.0 TreeView            
//BindTree();
【小山】ASP.NET2.0 TreeView
            InitTree();
【小山】ASP.NET2.0 TreeView        }

【小山】ASP.NET2.0 TreeView    }

【小山】ASP.NET2.0 TreeView
【小山】ASP.NET2.0 TreeView    
主從表繫結
【小山】ASP.NET2.0 TreeView
【小山】ASP.NET2.0 TreeView    
遞迴繫結同一個表資料
【小山】ASP.NET2.0 TreeView
請登入後發表評論 登入
全部評論

相關文章