CheckBox in Datalist ItemTemplate

Discussion in 'ASP .Net Web Controls' started by Sung, Sep 20, 2004.

  1. Sung

    Sung Guest

    Hi,
    I have a datalist contains ItemTemplate with a few controls. One of the
    controls is a CheckBox control which serves as user input rather than bound
    display control. When the page is submitted, I want to know the state of
    every CheckBox control in the datalist. Also, I have a hidden field which is
    a primary key of my SQL database table and I want to get that information as
    well. My datalist is bound from database except the checkbox as following:

    <asp:datalist id="CouponsList" runat="server" RepeatColumns="1" Width="600">
    <ItemTemplate>
    <table border="0" width="600">
    <tr>
    <td width="40" valign="middle">
    <asp:CheckBox id="ckbSelect" runat="server"></asp:CheckBox>
    </td>
    <td width="2">
    <asp:label class="Normal" id="lblStoreID" runat="server"
    Visible="false">
    <%# DataBinder.Eval(Container.DataItem, "SomeSQLTableID") %>
    </asp:label>
    </td>
    //... other bound controls
    </tr>
    </table>
    </ItemTemplate>
    </asp:datalist>

    In the behind code I check the check state and if it's selected, I get the
    ID. How can I do this?

    Any help would be appreciated.
     
    Sung, Sep 20, 2004
    #1
    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. Nevyn Twyll
    Replies:
    8
    Views:
    1,879
  2. Bennett Haselton
    Replies:
    1
    Views:
    5,341
    Joe Fallon
    Sep 24, 2004
  3. =?Utf-8?B?TWlsYW5C?=

    Access CheckBox in DataGrid ItemTemplate

    =?Utf-8?B?TWlsYW5C?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,752
    Eliyahu Goldin
    Jul 19, 2005
  4. Replies:
    1
    Views:
    454
  5. keerts23
    Replies:
    0
    Views:
    455
    keerts23
    Jul 29, 2009
Loading...

Share This Page