I can add items to a cart all good and well but when i checkout i want to be able to remove unwanted items. i have my code to add the items to a cart i taught myself ajax just to add the items together but on the checkout page i don't know how to show all the items in the cart, i use sessions as well. I'm in my first year so things are still new to me here
Here is my code :
<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Meat.aspx.cs" Inherits="Dial_A_Braai.Meat" Title="Untitled Page" %>

alt="" style="background-color: #FFFFFF" />
10 & More Servings....
When buying 10 items from us, you will receive a free salad of your choice with your purchase. you can view the salads in the "Salads" section under Catergories
T-Boned-Steak

R30.00
onclick="btnBuy4_Click">Add to Tray
Baby T-Boned Steak

R20.00
CssClass="prod_buy" onclick="btnBuy5_Click">Add to Tray
Lamb Loin Chop

R125.00
onclick="btnBuy6_Click">Add to Tray
Lamb Chump Chops

R125.00
onclick="btnBuy7_Click">Add to Tray
Steak-Tenderized

R120.00
onclick="btnBuy8_Click">Add to Tray
Rump Steak

R120.00
onclick="btnBuy9_Click">Add to Tray
Steak Fillet

R140.00
onclick="btnBuy10_Click">Add to Tray
Spare Rips

R140.00
onclick="btnBuy11_Click">Add to Tray
Sausage

R85.00
onclick="btnBuy12_Click">Add to Tray
Dinner Tray
Total:
What's new
Combo 3

R65.00
Code behind :
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
namespace Dial_A_Braai
{
public partial class Meat : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string x = Convert.ToString(Session["total"]);
string y = Convert.ToString(Session["qauntity"]);
if (x == "")
{
lblTotal.Text = "0.00";
lblQuantity.Text = "0";
}
else
{
lblQuantity.Text = y;
lblTotal.Text = x;
}
}
protected void btnBuy4_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 30.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy5_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 20.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy6_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 125.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy7_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 125.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy8_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 120.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy9_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 120.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy10_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 140.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy11_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 140.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
protected void btnBuy12_Click(object sender, EventArgs e)
{
double total = Convert.ToDouble(lblTotal.Text);
int qauntity = Convert.ToInt32(lblQuantity.Text);
qauntity += 1;
lblQuantity.Text = qauntity.ToString();
total += 85.00;
lblTotal.Text = total.ToString();
Session["total"] = lblTotal.Text;
Session["qauntity"] = lblQuantity.Text;
}
}
}
this code is for one of my pages that add items to cart. I don't want answers just some guidance on what tool to use maybe. It's pointless getting answers meaning i don't learn anything.
Thank you in advance
Replies
Know the answer? Post it — somebody with the same question will find it here.