想书目录一样,点左边的记录,右边出现该记录的相信信息。

解决方案 »

  1.   

    左邊用treeview , 右邊用gridview
      

  2.   

    在你左边控件的事件里的selectedchanged里添加事件,利用当前选择的数据进行查询,然后再右边的控件里显示
      

  3.   


     protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
     {
            string s = this.TreeView1.SelectedValue.Trim();
            string sql = "select * from table where column ='%"+ s +"%'";
            string constring = "connect string";
            SqlConnection con = new SqlConnection(constring);
            DataSet ds = new DataSet();
            SqlDataAdapter da = new SqlDataAdapter(sql,con);
            da.Fill(ds);
            this.GridView1.DataSource = ds;
            this.GridView1.DataBind(); }
      

  4.   

    关键问题是左边树的数据绑定和对应的数据库表的设计 在treeview的selectedchanged中添加事件 右边的部分用iframe元素引用另一个页面(即详细信息页 如a.aspx) 然后通过selectedchanged处理事件中的代码修改iframe的url属性(可以在url中传递关键字参数 如 a.aspx?bookId=102) 通过重载a.aspx显示详细信息
    当然也可以用session保存bookId 只在selectedchanged事件中重载a.aspx就行了
      

  5.   

    [color=#0000FF]非常感谢 ![/color]