Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement ASP.NET Shopping Cart? [closed]

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?

like image 492
Arief Avatar asked Jun 02 '09 09:06

Arief


People also ask

What is C# MVC?

MVC stands for Model, View, and Controller. MVC separates an application into three components - Model, View, and Controller. Model: Model represents the shape of the data. A class in C# is used to describe a model. Model objects store data retrieved from the database.


2 Answers

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".

like image 161
Josh Avatar answered Nov 04 '22 21:11

Josh


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.

like image 26
Stuart Avatar answered Nov 04 '22 21:11

Stuart