public void BindMenu(Menu mn,MenuItem menu,string mainMenu,string sql)
{
MenuItem mitem = null;
DB db = new DB();
DataSet ds = db.GetDataSet(sql, "table1");
DataTable dTable = ds.Tables[];
DataRow[] drow = dTable.Select(" parentId='" + mainMenu + "'");
foreach (DataRow dr in drow)
{
mitem = new MenuItem();
mitem.Text = dr["modulName"].ToString();
mitem.Value = dr["modulId"].ToString();
mitem.NavigateUrl = "Default.aspx";
if (menu == null)
{
mn.Items.Add(mitem);
}
else
{
menu.ChildItems.Add(mitem);
}
DataSet dst = db.GetDataSet(sql, "table2");
DataTable dtb = dst.Tables[];
DataRow[] dar = dtb.Select(" parentId='" + mitem.Value + "'");
mainMenu = mitem.Value;
BindMenu(Menu1, mitem, mainMenu, sql);
}
}