Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strangest Control behaviour ?!

Reply
Thread Tools

Strangest Control behaviour ?!

 
 
Emilio
Guest
Posts: n/a
 
      10-15-2003
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


 
Reply With Quote
 
 
 
 
Emilio
Guest
Posts: n/a
 
      10-15-2003
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.

"Emilio" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lisp toy: strangest warning I've seen luserXtrog C Programming 23 05-17-2009 09:22 AM
Strangest Wireless Problem I've Ever Seen KlausK Wireless Networking 5 06-16-2008 07:05 PM
Strangest damn error - database at fault? Neo Geshel ASP .Net 7 07-01-2005 08:51 AM
Strangest IPSec thing... Ivan Ostreš Cisco 3 02-09-2005 08:28 AM
The strangest problem.... Jannick C Programming 27 10-17-2003 12:34 PM



Advertisments