I have a grid control in a VB.Net page and the item template is as follows
<ItemTemplate>
<cc1:vprCheckBox runat="server" id="chkQLItem" Checked='<%# Eval("selected")%>' />
</ItemTemplate>
On postback the id for this control is
<_ctl0_maincontent_grdql__ctl10_chkqlitem>on</_ctl0_maincontent_grdql__ctl10_chkqlitem>
Is there a way I could set it to include an ID, such as
<cc1:vprCheckBox runat="server" id="chkQLItem_<%#Eval('QLKey')%>" Checked='<%# Eval("selected")%>' />
So the output would be chkQLItem_123
Try below:
<ItemTemplate>
<cc1:vprCheckBox runat="server" id="chkQLItem_<%# ((RepeaterItem)Container).ItemIndex + 1%>"Checked='<%# Eval("selected")%>' />
</ItemTemplate>
You can tweak it as well as per your requirements. Hope this helps!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.