用微软的和非微软的控件头都搞大的。有相当一部分功能不能实现。或者功能起来复杂。
以前没写过控件,刚好学习学习写自己的控件。
求过来人指点。
求思路。
------解决方案--------------------------------------------------------
JS Tree参考~*************************************************
本内容使用CSDN小秘书回复
每天回帖即可得10分可用分!
*************************************************
------解决方案--------------------------------------------------------
路过帮顶!!!
建议你看看《庖丁解牛:纵向切入ASP.NET3.5控件和组件开发技术》
------解决方案--------------------------------------------------------
http://blog.csdn.net/ChengKing/category/288694.aspx
这是作者的博客、
------解决方案--------------------------------------------------------
这是我自己写的 你可以参考一下 他是不用控件做的
控件是知其然,不知其所以然[code=VB.NET][/code]
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using LinkDataDALTableAdapters;
public partial class linkData_Default3 : System.Web.UI.Page
{
DeptTableAdapter _DeptTableAdapter = new DeptTableAdapter();
SpecialtyTableAdapter _SpecialtyTableAdapter = new SpecialtyTableAdapter();
ClassTableAdapter _ClassTableAdapter = new ClassTableAdapter();
StudentTableAdapter _StudentTableAdapter = new StudentTableAdapter();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
CreateTree();
}
private void CreateTree()
{
DataTable myTable1 = _DeptTableAdapter.GetData();
for (int i = 0; i < myTable1.Rows.Count; i++)
{
TreeNode node1;
node1 = new TreeNode(myTable1.Rows[i][1].ToString(), myTable1.Rows[i][0].ToString());//法政系
TreeView1.Nodes.Add(node1);
DataTable myTable2 = _SpecialtyTableAdapter.GetDataByDeptId(Convert.ToInt16(myTable1.Rows[i][0]));
for (int j = 0; j < myTable2.Rows.Count; j++)
{
TreeNode node2;
node2 = new TreeNode(myTable2.Rows[j][1].ToString(), myTable2.Rows[j][0].ToString());
node1.ChildNodes.Add(node2);
DataTable myTable3 = _ClassTableAdapter.GetDataBySid(Convert.ToInt16(myTable2.Rows[j][0]));
for (int k = 0; k < myTable3.Rows.Count; k++)
{
TreeNode node3;
node3 = new TreeNode(myTable3.Rows[k][1].ToString(), myTable3.Rows[k][0].ToString());
node2.ChildNodes.Add(node3);
}
}
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
string a = TreeView1.ExpandDepth.ToString();
Response.Write(a);
}
}
------解决方案--------------------------------------------------------
treeivew
还有codeproject
------解决方案--------------------------------------------------------
public partial class LeftTreeView : System.Web.UI.Page
{
protected DataTable dataTbl1, dataTbl2;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
string wherstr="";
if (Request.Cookies["Username"].Value.ToString().ToLower () == "admin" && Request.Cookies["Password"].Value.ToString() == "1")
{
wherstr = "";
}