views:

699

answers:

5

I tried to find similar questions but with no luck. Anybody can give me an idea how to build a Shopping Cart in ASP.NET the best practice way?

I know a wayto use Session but I think it would be painful to maintain the Session across pages. I've heard also to use Profile.

So which one do I have to choose? Which one is the best and most recommended solution?

Thanks in advance

+1  A: 

Hi Seems a bit vague question, I presume you asking how to build the whole application which is hard to answer in brief

Googling pulled up an excellent article:

http://net.tutsplus.com/tutorials/other/build-a-shopping-cart-in-aspnet/

also look at this:

http://codebetter.com/blogs/david.hayden/archive/2005/03/22/60166.aspx

Regarding session state, from my experience, sessionstate is useful on a single server set up, but if you thinking ahead and need scalability to web farm scenario, additional issues arise with serialising data. This is needed when storing session state in sql server. adding a lot of complexity to your application.

Stuart
Actually not the whole application, just the shopping cart. The URLs you gave me indeed bring up some ideas, but I still want to know if there is a standard way of implementing this.thanks
Arief Iman Santoso
+4  A: 

I've built many using the following methods:

  • Create a Database Table Called ShoppingCart
  • Store a Your ASP.NET session as Foreign Key
  • Either Add a ProductID per row or store a list of ProductIDs per row. This usually depends on if you have meta data you need to store about each product, such as quantity or size. The more meta data, the easier it is to manage if you store one product per row.

A good book that covers e-commerce is the APress book "Beginning ASP.NET 2.0 E-Commerce".

Josh
A: 

I think, that good way is use turn-key e-commerce solution. For example: http://advantshop.com/

A: 

Yes, as other poster says, building one from scratch is very big job. If you have to ask how to do it, then you probably will struggle!

We've just started using Kartris - http://www.kartris.com

Marcus D