S
simon
I have dataRepeater with itemtemlate:
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"adv_name") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"adv_start") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval(Container.DataItem,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox.
I don't know why, it would be much easier.
But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.
How can I do that? Can I pass the
DataBinder.Eval(Container.DataItem,"adv_ID") to the OnItemDataBound event? I
need this value because it represents the ID property of my checkBox
control.
Any example?
At the end, when user clicks button, I must read the clicked checkboxes.
Thank you,
Simon
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"adv_name") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"adv_start") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"adv_end") %></td>
<td align=center>
<asp:CheckBox Runat=server ID='<%#
DataBinder.Eval(Container.DataItem,"adv_ID") %>'></asp:CheckBox>
</td>
</tr>
</ItemTemplate>
This doesn't work. I can't dynamically set the ID of an ASP.NET CheckBox.
I don't know why, it would be much easier.
But by the book, I can handle the OnItemDataBound event and create the
checkbox dynamically, set the ID property, and insert the
control to the Repeater.
How can I do that? Can I pass the
DataBinder.Eval(Container.DataItem,"adv_ID") to the OnItemDataBound event? I
need this value because it represents the ID property of my checkBox
control.
Any example?
At the end, when user clicks button, I must read the clicked checkboxes.
Thank you,
Simon