Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > shopping cart concept

Reply
Thread Tools

shopping cart concept

 
 
Paulo
Guest
Posts: n/a
 
      05-16-2008
Hi, beginner on asp.net 2.0 C# VS 2005, how can I use the shopping cart
concept on my application? When the user clicks add item, it will be stored
on some storage format, I dont know what is the term: temp/global DataSet,
etc... and it should be read on other web-form to checkout the items...

Can you point me to the right direction?

Thank you very much!


 
Reply With Quote
 
 
 
 
Paulo
Guest
Posts: n/a
 
      05-16-2008
Mark, what do you think about this solution? Good or bad?

http://www.sitepoint.com/article/net...art-datatables

Thank you very much!

"Mark Rae [MVP]" <(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed)...
> "Paulo" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>> Hi, beginner on asp.net 2.0 C# VS 2005, how can I use the shopping cart
>> concept on my application? When the user clicks add item, it will be
>> stored on some storage format, I dont know what is the term: temp/global
>> DataSet, etc... and it should be read on other web-form to checkout the
>> items...

>
> Basically, you have several choices depending on how you've designed your
> web app, and what resources you have at your disposal...
>
> As you've discovered, the information in the shopping cart needs to be
> persisted (i.e. "remembered") across multiple pages. Therefore, you can't
> use ViewState. However, it's vital that different concurrent users don't
> get their shopping carts mixed up, so you can't use the Application object
> either.
>
> Does your web app use a back-end database? If so, then you can use that to
> store the shopping cart. This will also have the advantage that users
> could "save" their cart and come back to it later. Some people like to
> offer this facility...
>
> Alternatively, even if your web app does use a database, you might prefer
> to persist the cart information in the Session object. This is very simple
> to do. Obviously, if you use the Session object, then any information
> stored in it will be lost when the Session ends either because the user
> has logged out and you've torn down the Session in code, or because it has
> timed out...
>
> A third alternative would be to store the cart data in a cookie. However,
> this would obviously not work if the user has disabled cookies in their
> browser - some users do this for (supposed) security reasons.
>
> Personally, I use the Session object for shopping cart. I use a
> Dictionary<int, int> generic for this. The Dictionary is keyed on the
> product's unique identifier, and the value is the number of items
> purchased. This has the advantage of keeping the object persisted in
> Session as small as possible.
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Shopping Cart Scripts GeorgeF Perl 1 05-22-2005 04:41 AM
Shopping Cart - database vs session Paul Hobbs ASP .Net 2 12-04-2003 08:35 PM
OT: Shopping cart reccomendations John ASP .Net 1 11-07-2003 05:16 PM
Shopping Cart Component Suggestions Mark Fox ASP .Net 1 11-04-2003 10:02 AM
Secure shopping cart example? Bruce W...1 ASP .Net 3 08-27-2003 06:48 PM



Advertisments