Strangest Control behaviour ?!

Discussion in 'ASP .Net' started by Emilio, Oct 15, 2003.

  1. Emilio

    Emilio Guest

    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
     
    Emilio, Oct 15, 2003
    #1
    1. Advertising

  2. Emilio

    Emilio Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
     
    Emilio, Oct 15, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neo Geshel
    Replies:
    7
    Views:
    514
    Neo Geshel
    Jul 1, 2005
  2. Jannick

    The strangest problem....

    Jannick, Oct 9, 2003, in forum: C Programming
    Replies:
    27
    Views:
    775
    Dan Pop
    Oct 17, 2003
  3. Andy Chambers
    Replies:
    1
    Views:
    403
    Daniel Dyer
    May 14, 2007
  4. luserXtrog

    lisp toy: strangest warning I've seen

    luserXtrog, May 11, 2009, in forum: C Programming
    Replies:
    23
    Views:
    994
    luserXtrog
    May 17, 2009
  5. Trans
    Replies:
    2
    Views:
    123
    Trans
    Aug 19, 2005
Loading...

Share This Page