add checked items to a cart

Discussion in 'ASP .Net Datagrid Control' started by Adam, Sep 17, 2003.

  1. Adam

    Adam Guest

    Hi,

    I have a datagrid with checkbox column inserted, it's allow user to add
    serveral checked items to a cart when they click submit button, the code
    looks like:

    <asp:DataGrid id="Productlist" runat="server" />
    <ItemTemplate> <asp:CheckBox id="Save" runat="server" /> </ItemTemplate>
    </asp:DataGrid>
    <html>
    <asp:Button id="Submit" onclick="add_saved_items" runat="server" />
    <asp:DataGrid id="mycart" runat="server" />
    </html>

    I think "add_saved_items" event should be like below but I don't know how to
    write full code to let it works.

    Sub Submit_Click (sender As Object, e As System.EventArgs)
    Dim i As Integer
    For i = 0 To Productlist.Items.Count - 1
    Dim save As CheckBox =
    CType(Productlist.Items(i).FindControl("Save"), CheckBox)
    If save.Checked = True then
    .................

    Anyone can help me please?
    Adam, Sep 17, 2003
    #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. yurps
    Replies:
    1
    Views:
    6,853
    rajeshthangarasu1983
    Feb 29, 2008
  2. Wayne  Wengert

    Marking CheckBoxList Items as Checked

    Wayne Wengert, Mar 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    32,507
    Wayne Wengert
    Mar 2, 2005
  3. =?Utf-8?B?TWlrZSBDb2xsaW5z?=

    Custom Validator to validate certain items checked in a checkboxli

    =?Utf-8?B?TWlrZSBDb2xsaW5z?=, Aug 10, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,287
    =?Utf-8?B?TWlrZSBDb2xsaW5z?=
    Aug 10, 2006
  4. Daku
    Replies:
    2
    Views:
    4,539
    Wojtek
    Feb 25, 2010
  5. Rob Meade
    Replies:
    9
    Views:
    284
    Anthony Jones
    Jun 18, 2006
Loading...

Share This Page