asp.net中TreeView1用法-树型菜单
#region 树型菜单TreeView1
/// <summary>
/// 树型菜单TreeView1
/// </summary>
/// <param name="t1">TreeView空件</param>
/// <param name="boot">父目录sql语句</param>
/// <param name="chird">子目录sql语句</param>
/// <returns></returns>
public TreeView tree(TreeView t1, string boot, string chird)
{
con.Open();
DataSet dssuper = dss(boot);
DataSet dssub = dss(chird);
DataRow[] rows = dssuper.Tables[0].Select();
DataRow[] subrows = dssub.Tables[0].Select();
//if (!IsPostBack)
//{
foreach (DataRow row in rows)
{
TreeNode nd = new TreeNode();
nd.Text = row["t_name"].ToString();
nd.Value = row["t_id"].ToString();
nd.NavigateUrl = row["t_url"].ToString();
t1.Nodes.Add(nd);
foreach (DataRow subrow in subrows)
{
TreeNo
下一篇:c#备份access数据库文件
