Adding a checkbox to a repeater control

D

Doogie

Why is this code not allowing me to add a checkbox to it?

<asp:repeater ID="RptTrip" Runat="server" EnableViewState="false">
<ItemTemplate>
<asp:Checkbox AutoPostBack="True" ID="cb" runat="server"
Checked="false"></asp:Checkbox>
<trip_detail_info trip_detail_id ='<%#
Container.DataItem("trip_detail_id")%>'
leg_start_dt = '<%# Container.DataItem("leg_start_dt")%>'
pickup_iso_dt = '<%# Container.DataItem("pickup_iso_dt")
%>' />
</ItemTemplate>
</asp:repeater>

I keep getting a "Control 'RptTrip__ctl0_cb' of type 'CheckBox' must
be placed inside a form tag with runat=server. " message even though I
obviously already have that tag in the control.
 
D

Doogie

Never mind. I found it...the xml the repeater code was tied to is not
inside the form tag. If I put it in the form tag it no longer gives
me that error (but it does seem to indicate that xml tag should not be
inside the form tag so I need to delve into this further.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top