Strangest Control behaviour ?!

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
 
E

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.
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top