A
-------700,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
-------800,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
-------900,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
.......
B
-------700,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
-------800,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
-------900,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif)
........不知道这个Show,rule,image如何实现啊,用户还的点击show和rule跳转页面。没有使用过treeview,请大家看看能否实现啊
谢谢!

解决方案 »

  1.   

    呵呵,就是我的第二级别的-------700,A,Show(1.aspx),Rule(2.aspx),Image(../img.1.gif) 
    是这些数据,但是要分别有不同url连接。但是鼠标点击仅仅是一个连接啊谢谢!
      

  2.   

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;public partial class _Default : System.Web.UI.Page 
    {
        private  static SqlConnection con;
        private SqlCommand com;
        private DataSet objdataset;
      
        private SqlDataAdapter objdataapter;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(Page.IsPostBack))
                getss();
        }
        public  SqlConnection GetConn()
        {
            con = new SqlConnection("server=.;uid=sa;pwd=sa;database=jb_crm_team0");
            return con;
        }
       
        public void getss()
        {
            con = this.GetConn();
            string sql = "select right_text,right_code from sys_right where right_type='Folder'";
            objdataapter = new SqlDataAdapter(sql, con);
            objdataset = new DataSet();
            objdataapter.Fill(objdataset, "jobs");
             
              for (int i = 0; i < objdataset.Tables[0].Rows.Count; i++)
              {
                  TreeNode dd = new TreeNode();
                  dd.Text = objdataset.Tables[0].Rows[i]["right_text"].ToString();
                  dd.Value = objdataset.Tables[0].Rows[i]["right_text"].ToString();
                 this.TreeView1.Nodes.Add(dd);
                 string sql1 = "select right_text from sys_right where right_type='Document' and right_parent_code='"+objdataset.Tables[0].Rows[i]["right_code"].ToString()+"'";
                
                  con = this.GetConn();
                 con.Open();
                 com = new SqlCommand(sql1, con);
             SqlDataReader reader=com.ExecuteReader();
             while (reader.Read())
             { 
                 TreeNode dnn=new TreeNode();
                 dnn.Value=reader.GetValue(0).ToString();
                 dnn.Text=reader.GetValue(0).ToString();
                 this.TreeView1.Nodes[i].ChildNodes.Add(dnn);
             }
              }
        }
    }