add checked items to a cart

A

Adam

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?
 

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,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top