first, i'm sorry i'm newbie here and newbie in aspnet. i learn some code from ebook but it's not working. and i'm really sorry too because my english is bad. when i debug my project its working fine, and i try to add item to my shopping cart its not show any error but the button do not work, its ike the product page only reload. i hope i can find the answer here. thanks for help. here the code CartAccess.cs
using System;
using System.Web;
using System.Data;
using System.Data.Common;
/// <summary>
/// Supports Shopping Cart functionality
/// </summary>
public class CartAccess
{
public CartAccess()
{
//
// TODO: Add constructor logic here
//
}
// returns the shopping cart ID for the current user
private static string shoppingCartId
{
get
{
HttpContext context = HttpContext.Current;
string cartId;
{
// check if the cart ID exists as a cookie
if (context.Request.Cookies\["Delta\_CartID"\] != null)
{
// return the id
//return context.Request.Cookies\["Delta\_CartID"\].Value;
cartId = context.Request.Cookies\["Delta\_CartID"\].Value;
return cartId;
}
else
// if the cart ID doesn't exist in the cookie as well, generate a new ID
{
// generate a new GUID
//Guid tempGuid = Guid.NewGuid();
//context.Response.Cookies\["Delta\_CartID"\].Value = tempGuid.ToString();
cartId = Guid.NewGuid().ToString();
// create the cookie object and set its value
HttpCookie cookie = new HttpCookie("Delta\_CartID", cartId);
// set the cookie's expiration
int howManyDays = deltaconfig.CartExpireDays;
DateTime currentDate = DateTime.Now;
TimeSpan timeSpan = new TimeSpan(howManyDays, 0, 0, 0);
DateTime expirationDate = currentDate.Add(timeSpan);
cookie.Expires = expirationDate;
// set the cookie on the client's browser
context.Response.Cookies.Add(cookie);
// return the CartID
return cartId.ToString();
}
}
}
}
// Add a new s