62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:Repeater ID="rep_gzfanwei" runat="server">
<ItemTemplate>
<input type="checkbox" id='chk_<%# Eval("mt_ID") %>' onclick="clickLabel(this)" /><label
for='chk_<%# Eval("mt_ID") %>'><%# Eval("mt_content") %></label>
<div id='div_<%# Eval("mt_ID") %>' style="display: none;">
<input id='lbl1_<%# Eval("mt_ID") %>' type="text" style="width: 20px;"></input>-
<input id='lbl2_<%# Eval("mt_ID") %>' type="text" style="width: 20px;"></input>元</div>
</ItemTemplate>
</asp:Repeater>
for (int i = 0; i < mtdt.Rows.Count; i++)
{
HiddenField hid=(HiddenField)rep_gzfanwei.Items[i].FindControl("repValue");
HtmlInputText tb1 = (HtmlInputText)rep_gzfanwei.Items[i].FindControl("lbl1_"+hid.Value);
HtmlInputText tb2 = (HtmlInputText)rep_gzfanwei.Items[i].FindControl("lbl2_" + hid.Value);
}
后台是这么写的。
断点的话,tb1这个对象为空。
各位大侠帮个忙吧。