i am trying to made s开发者_StackOverflowhopping portal. i want to add the add to cart against all the grid view rows. How can i add this coloumn in grid view? and the code for how to store the proper add to cart value in data table to store data temporaily?
Add a Template column like..
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="Button1" runat="server" Text="Add Cart" CommandName="ShoppingCart" />
</ItemTemplate>
</asp:TemplateField>
And then handle the Row command event, where you get:
protected void gdvSearchResults_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "ShoppingCart")
{
//AddedControl here in Session Data table
}
}
精彩评论