62,073
社区成员
发帖
与我相关
我的任务
分享
private void WorkerList()
{
TreeNode node = new TreeNode();
TreeNode ParentNode;
SqlDataReader Dr;
DataBase DB = new DataBase();
node.Text = "上师大篮球队";
node.Value = "0";
TView_Name.Nodes.Add(node);
ParentNode = node;
Dr = DB.RunProcGetReader("select top 20 * from Users");
while (Dr.Read())
{
node = new TreeNode();
node.Text = Dr["UserName"].ToString();
node.Value = Dr["LoginName"].ToString();
ParentNode.ChildNodes.Add(node);
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="calendar.aspx.cs" Inherits="Rili.calendar" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body { margin:0;}
#content { width:1000px; margin:0 auto; }
#side { background: #99FF99; height:750px; width: 298px;
float: left; }
#main { background: #99FFFF; height:750px; margin:0; }
#TreeDiv {overflow:auto;}
#side1 { background: #99FF99; height: 300px; width: 120px; float: right; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="content">
<div id="side">此处显示 id "side" 的内容
<div id="TreeDiv">
<asp:TreeView ID="TView_Name" runat="server"
BorderColor="Black" BorderWidth="1px" Height="223px"
onselectednodechanged="TreeView1_SelectedNodeChanged" Width="139px"
ImageSet="Contacts" NodeIndent="10">
<HoverNodeStyle Font-Underline="False" />
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black"
HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" />
<ParentNodeStyle Font-Bold="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px"
VerticalPadding="0px" />
</asp:TreeView>
</div>
</div>
<div id="main">此处显示 id "main" 的内容</div>
</div>
</form>
</body>
</html>