repeat迴圈繫結ItemDataBound .
阿新 • • 發佈:2019-01-05
protected void rptproclass_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label menuid = (Label)e.Item.FindControl("lblid"); string menuids = menuid.Text.ToString(); DataTable pro = TOPRAND.COMMON.StaticFunction.getData("select top 4 * from K_Product where left(menuid,8) ='" + menuids + "' and len(menuid)>8 and IsPub=1"); Repeater repproduct1 = (Repeater)e.Item.FindControl("repproserver"); repproduct1.DataSource = pro; repproduct1.DataBind(); } }