event "addcheckitems"

A

Adam

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
simply as below:

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

for button "Submit" event:

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
addcheckitems
Next
Response.redirect "showcart.aspx"
End If

My question is how to write sub-program "addcheckitems", I tried long time
but not work out, help please!!!

Adam
 

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

Forum statistics

Threads
474,139
Messages
2,570,806
Members
47,352
Latest member
Maricruz09

Latest Threads

Top