if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Repeater rptSubMenu = e.Item.FindControl("rptSubMenu") as Repeater; DataRowView drv = (DataRowView)e.Item.DataItem; int menuId = Convert.ToInt32(drv["Menu_ID"]); rptSubMenu.DataSource = bll.GetList(99, "Parent_ID=" + menuId + " and MenuLv=2 and r.Role_ID=" + HttpContext.Current.Session["Role_ID"] + " and r.IsShow = 1", "m.iIndex asc"); rptSubMenu.DataBind(); }