嵌套Repeater的绑定

protected void repModule_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            DataList dbList = (DataList)e.Item.FindControl("dbRoles");
            string parentId = DataBinder.Eval(e.Item.DataItem, "id").ToString();   //获取当前行的绑定数据
            
            dbList.DataSource = DbCommand.GetNewTable(dtModule, "parentId="+parentId);
            dbList.DataBind();
        }
}   

你可能感兴趣的:(嵌套Repeater的绑定)