开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜