Repeater每行绑定事件代码

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();
        }
原文地址:https://www.cnblogs.com/zhb7769/p/9244347.html