views:

52

answers:

2

I am developing a custom shopping cart for which existing customers will need to log in to access their account.

I am trying to decide if ASP.NET membership is appropriate for all or part of the application.

  • It certainly makes sense for existing customers - you log in and get access to your order history and can make changes to your settings. Every page must be authenticated and if you lose that authentication cookie then you get logged out.
  • However for new customers they won't have an account until the last step so I'm not quite sure how ASP.NET membership would fit into that situation. Would I just create the user account but not actually require authentication on all the pages?

Can someone for whom this is obvious please comment

+2  A: 

The ASP.NET Membership system supports 'anonymous users', people that haven't created an account yet.

When they get to the point of actually creating an account you can choose to move over none/some/all of their profile information to their new account.

The MSDN library gives some pretty good examples, and has links to the specific forums on the Microsoft servers which will include lots of great information to get you started.

Timothy Walters
i'm not sure the membership system as such supports 'anonymous users' but the Profile certainly does (see http://odetocode.com/articles/440.aspx). please ping me back if i'm wrong
Simon_Weaver
Yes, the Profile does have specific support for 'anonymous users', the permissions system in ASP.NET can allow some parts of a secure site to be available to anonymous users (the ? you'll often see in web.config files). The Membership system's support for it is in the permissions that you apply.
Timothy Walters
+2  A: 

I think ASP.NET Membership would be suitable. The LoginView class handles this particular scenario. It enables you to specify content visible by authenticated users, and content for anonymous users.

A large portion of your layout will likely be similar for both types of users, so you would be able to re-use a lot of it through master pages and user controls. Then the differences can be emphasized as part of the LoginView templates.

Ahmad Mageed