asp.net Repeater取得CheckBox选中的某行某个值分享


1、
foreach (Control c in this.rptTables.Controls)
{
CheckBox cbx = (CheckBox)c.FindControl(“cbxId”);
TextBox tbx = (TextBox)c.FindControl(“tbxTableName”);
if (cbx != null)
{
if (cbx.Checked == true)
{
common.salert(tbx.Text);
}

}
}

2、
for (int i = 0; i < this.rptTables.Items.Count; i++)
{
CheckBox cbx = (CheckBox)rptTables.Items[i].FindControl(“cbxId”);
TextBox tbx = (TextBox)rptTables.Items[i].FindControl(“tbxTableName”);
if (cbx != null)
{
if (cbx != null)
{
if (cbx.Checked)
{
common.salert(tbx.Text);
}
}
}
}
关键点:在每行再写个隐藏的控件我是用TextBox,代码如下:
<asp:TextBox id=”tbxTableName” runat=”server” Text='<%#Eval(“TABLE_NAME”) %>’ style=”display:none;” />

—-想了解更多的linux相关异常处理怎么解决关注<计算机技术网(www.ctvol.com)!!>



本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/htmltutorial/71601.html

(0)
上一篇 2020年4月13日
下一篇 2020年4月13日

精彩推荐