Monday, March 26, 2012

What is the best approach for subscription based membership in asp.net 2.0?

I'm trying to create an application where customers can pick a free triel or do a yearly subcribe and after that it saves their information to the database. I have been told to stay away from membership provider because it won't let you customize rules sets between members (free trial users and paid members). What is the best practice to accomplish that?

Basically when the member login I want them to be in session. I used session states before to retain their information. But what is the newer way of authentication and retaining the user information in asp.net 2.0?

Thanks!

Couldn't you use the membership provider and put the two different member types in different roles (e.g. have a "Trial Member" role and then a "Paid Member" role)? This would allow you to customize rule sets between those two types unless your situation is more complex than that. Just a suggestion.

Jason


Using the Create Member Wizard is your best option. You can add steps to the wizard to establish a member as a trial or paid member and store that in your database (do not customize the ASPNETDB (membership provider DB).

You could also look into establishing Roles with the Roles provider and by default add all new members to a "Trial" role and then in the admin upon paid membership add them to the "Paid" roll.

But I would not avoid membership provider.

Here are some resources on customzing the createuserwizard.

http://msdn2.microsoft.com/en-us/library/ms178342.aspx

http://aspnet.4guysfromrolla.com/articles/070506-1.aspx


shehz81:

I'm trying to create an application where customers can pick a free triel or do a yearly subcribe and after that it saves their information to the database. I have been told to stay away from membership provider because it won't let you customize rules sets between members (free trial users and paid members). What is the best practice to accomplish that?

Basically when the member login I want them to be in session. I used session states before to retain their information. But what is the newer way of authentication and retaining the user information in asp.net 2.0?

Thanks!

You can use membership provider since it will give you the majority of functionality you need.

For subscription service, you can set up roles like "trial user", "paid user" etc.. Add users to roles according to their status and restrict access based on their role.


Super. that answers first part of question. so I can create a seperate user table and still use the controls. The sticking point I see in registration is, can you process payments with Create Member Wizard, given I have my own sets of gateway code to do that? the user have to pick from the registration form whether they are trial or paid members. Based on their selection I have to perform seperate methods. Can this be done?

2. How do you handle login functionalities then? When you are dealing with paid or trial members you have different login rules.Suppose there trial membership is expired then how does the built in login feature knows that?

I have all the logics in place but not sure on how to incorporate with the new asp.net 2.0 membership controls. Thats all.

Thank You guys!


With expired trial memberships I wouldn't use the Roles manger then.

I would create your own DB to handle membership and membership types, that way you can look at expirationdates etc.

Customize your wizard based upon your business rules. Does a trial membership still require creditcard information (which is to be charged after trial membership is up)? etc...

In the wizard set LoginCreatedUser = True to auto log them in once created. Set the FinishDestinationPageUrl to go to a validation page. The login page will also go to that page.

In your validation page validate the logged in users membership status

status = Trial, Paid, Expired, NonMember

for example. Then redirect as necessary based upon status.


Yes, it can be done. You just have to customize the CreateUserWizard so that depending on whether they want to pay for membership or just have a trial, you would direct them to a different wizard step. You could also make two different CreateUserWizards, one for trial and one for paid. It just depends on how you choose to implement it. But yes, you can customize the CreateUserWizard to your liking.

To answer your other question...you can overload the Login control to check which role the user is in, or have a check with each page to see if they are past the expiration date. If they are past the date, then just force them to be redirected to a payment page, or something. There are several different ways to do it, and it probably depends on how exactly you have everything set up. Good luck!

Jason


Thanks for great suggestions. It seems I have enough information to start on create wizard tool.

0 comments:

Post a Comment