A
Alan Silver
Hello,
I have a form that contains a repeater. A simplified version of the
ItemTemplate is shown below (air code)...
<br><asp:Literal id="litID" runat="server" />
<br><asp:TextBox id="txtQty" runat="server" />
<hr>
This basically shows a list of item IDs, with quantities for each one.
The quantity is in a text box so the user can change it. I set the Text
properties in the ItemDataBound event.
When the page is posted back, I want to go through the repeater and
update a database based on the info in it. After that, I will bind the
repeater to the database data and have the new info displayed.
The problem is that the repeater does not contain any items on postback.
I tried looping through the Items collection, but it's empty. The tag
for the repeater looks like...
<asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
RunAt="Server">
so it's not that I've turned off the view state.
The one point that might be relevant here is that the repeater and its
code are inside a user control. Don't know if this makes any difference.
Any ideas? I know the info is there, as if I dump the form contents to
the page, I see form fields with names like
_ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
there. I don't see anything for the literals though.
Please help, I'm really stuck here. TIA
I have a form that contains a repeater. A simplified version of the
ItemTemplate is shown below (air code)...
<br><asp:Literal id="litID" runat="server" />
<br><asp:TextBox id="txtQty" runat="server" />
<hr>
This basically shows a list of item IDs, with quantities for each one.
The quantity is in a text box so the user can change it. I set the Text
properties in the ItemDataBound event.
When the page is posted back, I want to go through the repeater and
update a database based on the info in it. After that, I will bind the
repeater to the database data and have the new info displayed.
The problem is that the repeater does not contain any items on postback.
I tried looping through the Items collection, but it's empty. The tag
for the repeater looks like...
<asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
RunAt="Server">
so it's not that I've turned off the view state.
The one point that might be relevant here is that the repeater and its
code are inside a user control. Don't know if this makes any difference.
Any ideas? I know the info is there, as if I dump the form contents to
the page, I see form fields with names like
_ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
there. I don't see anything for the literals though.
Please help, I'm really stuck here. TIA