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>
.....
<aspataGrid id="Productlist" runat="server" />
<ItemTemplate> <asp:CheckBox id="Save" runat="server" /> </ItemTemplate>
....
</aspataGrid>
<asp:Button id="Submit" onclick="add_saved_items" runat="server" />
......
<aspataGrid 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
serveral checked items to a cart when they click submit button, the code
simply as below:
<html>
.....
<aspataGrid id="Productlist" runat="server" />
<ItemTemplate> <asp:CheckBox id="Save" runat="server" /> </ItemTemplate>
....
</aspataGrid>
<asp:Button id="Submit" onclick="add_saved_items" runat="server" />
......
<aspataGrid 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