protected void Page_Load(object sender, EventArgs e)
        {
            //fansyClass.Menu menu = new fansyClass.Menu(1);
            if (!IsPostBack)
            {
                DataSet ds = SQLHelper.Query("select * from menu where parentid=0");
                //this.Menu.DataSource = ds;
                //this.Menu.DataBind();                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    MenuItem menuitem = new MenuItem();
                    menuitem.Text = ds.Tables[0].Rows[i]["Name"].ToString();
                    menuitem.Value = ds.Tables[0].Rows[i]["ID"].ToString();
                    menuitem.NavigateUrl = ds.Tables[0].Rows[i]["Src"].ToString();
                    this.testMenu.Items.Add(menuitem);
                    getchild(ds.Tables[0].Rows[i]["ID"].ToString(), menuitem);
                }
            }
        }
        public void getchild(string id,MenuItem item)
        {
            DataSet ds = SQLHelper.Query("select * from menu where parentid='" + id+ "'");
            for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
            {
                MenuItem childitem = new MenuItem();
                childitem.Text = ds.Tables[0].Rows[j]["Name"].ToString();
                childitem.Value = ds.Tables[0].Rows[j]["ID"].ToString();
                childitem.NavigateUrl = ds.Tables[0].Rows[j]["Src"].ToString();
                item.ChildItems.Add(childitem);
                getchild(ds.Tables[0].Rows[j]["ID"].ToString(), childitem);
            }
        }
我这段是menu控件的绑定.帮我看看那里不对.我执行出来的结果都绑定在第一层了.