在Repeater中循环遍历input的值,为什么exceptions会为空?
如果想保存在String name中改如何保存?
前台:
" />
for (int i = 0; i < rptList.Items.Count; i++)
{
HtmlInputText txt_exceptions = (HtmlInputText)rptList.Items[i].FindControl("txt_name");
}
repeater2 数据源查询的一个条件值 是repeater1的一个值,这个值是跟repeater2 在同一行的吗?
如果是的话可以使用repeater1的itemdatabound事件来绑定
protected voidrepeater1_itemdatabound(object sender, repeateritemeventargs e)
{
if (e.item.itemtype == listitemtype.item || e.item.itemtype == listitemtype.alternatingitem)
{
label lbljobcategoryid = e.item.findcontrol("lbljobcategoryid") as label;
label lblcategoryname = e.item.findcontrol("lblcategoryname") as label;
jobcategory entityjobcategory = new jobcategory();
repeater repeater2= e.item.findcontrol("repeater2") as repeater;
var source = entityjobcategory.getjobcategorycontact(lbljobcategoryid.text.toint());
repeater2.datasource = source;
repeater2.databind();
}
}
如果不是的话只能绑定完repeater1之后遍历整个repeater1
foreach (gridviewrow gdrow in repeater1.rows)
{
label lbljobcategoryid = gdrow.findcontrol("lbljobcategoryid") as label;
label lblcategoryname = gdrow.findcontrol("lblcategoryname") as label;
jobcategory entityjobcategory = new jobcategory();
repeater repeater2= gdrow.findcontrol("repeater2") as repeater;
var source = entityjobcategory.getjobcategorycontact(lbljobcategoryid.text.toint());
repeater2.datasource = source;
repeater2.databind();
}
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息