开发者

how to implement the add the add to cart in grid view?

开发者 https://www.devze.com 2023-02-25 12:32 出处:网络
i am trying to made s开发者_StackOverflowhopping portal. i want to add the add to cart against all the grid view rows.

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 
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号