中继器中的数据表 [英] datatable in repeater

查看:102
本文介绍了中继器中的数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在转发器控件中,我正在使用复选框选择某些值,如何将所选值带到数据表中.

in repeater control , i am selecting certain values using checkbox,how to bring the selected values to the datatable .

推荐答案

尝试类似的方法:

HTML:
Try something like:

HTML:
<asp:repeater id="rlist" runat="server">
  <ItemTemplate>
    <asp:CheckBox ID="chkboxSelection" Checked=true Runat="server" Enabled="true"></asp:CheckBox>
    <asp:Label ID="hdnStoreID" Visible="false" Text='<%#DataBinder.Eval(Container.DataItem, "SomeText") %>' runat=server></asp:Label>
  </ItemTemplate>
</asp:repeater>


背后的代码:


Code behind:

RepeaterItemCollection rc = rlist.Items;

foreach (RepeaterItem Item in rc) {
	CheckBox myCheckBox = (CheckBox)Item.FindControl("chkboxSelection");
	if (myCheckBox.Checked == true) {
		strJobID = ((Label)Item.FindControl("hdnStoreID")).Text;
		// Do whatever you like with this text now
	}
}


这篇关于中继器中的数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆