Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

setengah

@setengah
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • cannot do add to cart function
    S setengah

    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
    
    ASP.NET help asp-net debugging
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups