Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Reply to Thread

Post a reply to the thread: ASP.NET shopping cart error in C#?

Your Message

Click here to log in

In what corner do we have Search box?

 
 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Rate Thread

You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.

Topic Review (Newest First)

  • 01-23-2013, 10:40 AM
    shysarah2003

    ASP.NET shopping cart error in C#?

    i am working on a shopping cart for a project and i'm really stuck. ASP.NET seams to be really hard
    I get this error
    Unable to cast object of type 'System.String' to type 'System.Collections.Generic.List`1[System.String]'.
    At this line of code
    var values = (List<string>)Session["Cart"];
    Any help would be nice!
    if (Session["Cart"] == null)
    {
    Response.Redirect("Products.aspx", false);
    }

    {
    var values = (List<string>)Session["Cart"];
    if (values.Count <= 0)
    {
    Response.Redirect("Products.aspx", false);
    }
    }
    This error only happens if i have 1 item only in the cart

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •