Strangest Control behaviour ?!

  • Thread starter Thread starter Emilio
  • Start date Start date
E

Emilio

Hi,

I have a user control with a datalist. Each datalistitem has a label which
is databound, a hidden textbox which is databound, a textbox and a checkbox.

like follows:

<asp:datalist id="dlBottleSize" runat="server" width="285px"
EnableViewState="True">
<ItemTemplate>
<table class="formtable">
<tr>
<td class="blue" style="width:40%;">
<input type="hidden" id="txtMeasurementID" value="<%#
container.dataitem(0) %>" runat=server/>
<asp:Label ID=lblSize text="<%# container.dataitem(1) %>"
Runat="server"/>
</td>
<td class="white" style="width:35%;text-align:center;">
<asp:TextBox ID="txtBottleSize" Cssclass="NormalTextBox" Width="25"
Runat="server" />
</td>
<td class="white" style="width:25%;">
<asp:CheckBox ID="chkListBottleSize" Runat="server" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>

The issue however is that the values for the textbox and the checkbox are
not picked up after a postback, the viewstate is working and a
request.form.get() returns the values but a
Ctype(datalistitem.findcontrol("ControlID"), ControlType).property doesn't
pick-up the text entered into the textbox or whether the checkbox is
checked. Is it just because there is a full moon here at the moment?

Many thanks

Emilio
 
It seems to be a user control issue of some sort. Another user control that
I use on the same page will also not give me the information (selected items
in a listbox) and there isn't a datalist in site!

The code i am using to get the values in the ascx is in the ascx 's
code-behind and values are passed via properties in the ascx.
 
Back
Top