Repeater每行绑定事件代码
阅读原文时间:2023年07月09日阅读:1

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(, "Parent_ID=" + menuId + " and MenuLv=2 and r.Role_ID=" + HttpContext.Current.Session["Role_ID"] + " and r.IsShow = 1", "m.iIndex asc");
rptSubMenu.DataBind();
}