How do I create a shopping basket using asp.net 2010 vb. I have created a grid view of products and a click to the add to basket button is not bringing the results to the basket.
This is what I have. Whats the way forward?
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Advertise.aspx.vb" Inherits="Advertise" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server" ViewStateMode="Enabled">
Product Name | <asp:TextBox ID="TextBoxProductName" runat="server">
| |
| | |
<asp:Button ID="ButtonSearch" runat="server" Text="Search" />
| | |
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"
ForeColor="#333333" GridLines="None">
<alternatingrowstyle backcolor="White">
<columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID"
InsertVisible="False" ReadOnly="True" SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="Decsription" HeaderText="Decsription"
SortExpression="Decsription" />
<asp:BoundField DataField="Category" HeaderText="Category"
SortExpression="Category" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
<asp:ButtonField CommandName="AddToBasket" Text="Add To Basket" />
<editrowstyle backcolor="#2461BF">
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center">
<rowstyle backcolor="#EFF3FB">
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333"
BorderStyle="Solid" />
<sortedascendingcellstyle backcolor="#F5F7FB">
<sortedascendingheaderstyle backcolor="#6D95E1">
<sorteddescendingcellstyle backcolor="#E9EBEF">
<sorteddescendingheaderstyle backcolor="#4870BE">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString1 %>"
SelectCommand="SELECT DISTINCT * FROM [Product] WHERE ([ProductName] LIKE '%' + @ProductName + '%')">
<SelectParameters>
<asp:ControlParameter ControlID="TextBoxProductName" Name="ProductName"
PropertyName="Text" Type="String" />
</SelectParameters>
<asp:View ID="ViewBasket" runat="server" ViewStateMode="Enabled">
Basket<asp:GridView ID="GridViewBasket"
runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True" CellPadding="4" ClientIDMode="AutoID"
DataKeyNames="ProductID" ForeColor="#333333"
GridLines="Horizontal" EnablePersistedSelection="True" PageIndex="1">
<alternatingrowstyle backcolor="White">
<columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID" ReadOnly="True"
SortExpression="ProductID" />
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
ReadOnly="True" SortExpression="ProductName" />
<asp:TemplateField HeaderText="Quantity">
<itemtemplate>
<asp:TextBox ID="TextBoxQuantity" runat="server">
<asp:LinkButton ID="Remove" runat="server" CommandName="Remove">Remove
<asp:BoundField DataField="Price" DataFormatString="{0:c}" HeaderText="Price"
ReadOnly="True" />
<asp:BoundField DataField="TotalCost" DataFormatString="{0:c}"
HeaderText="Total Cost" />
<editrowstyle backcolor="#2461BF">
<footerstyle backcolor="#507CD1" font-bold="True" forecolor="White">
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center">
<rowstyle backcolor="#EFF3FB">
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<sortedascendingcellstyle backcolor="#F5F7FB">
<sortedascendingheaderstyle backcolor="#6D95E1">
<sorteddescendingcellstyle backcolor="#E9EBEF">
<sorteddescendingheaderstyle backcolor="#4870BE">
Total Price<asp:Label ID="Label1" runat="server" Text="Label">
<asp:View ID="View3" runat="server">
<asp:View ID="View4" runat="server">
<asp:View ID="View5" runat="server">
<asp:View ID="View6" runat="server">