views:

340

answers:

4

I am looking to register 2 styles of user, they will both have different sets of data in the database.

I am looking to use asp.nets membership roles. Are there any simple ways to do this in an mvc app using maybe the account controller?

+3  A: 

What about using the ASP.NET configuration tool?
You can easily use the Authorize(Roles = "...") attributes on your controllers and actions.

trendl
I'm also using this tool to define roles and create users. What's left it to simply tag your actions with "Authorise". My issue though with this tool is if you can use this tool once the application is deployed?
gugulethun
A: 

here are some good tutorials to help you out.

http://www.squaredroot.com/post/2007/12/ASPNet-MVC-Membership-Basics.aspx

http://schotime.net/blog/index.php/2009/02/17/custom-authorization-with-aspnet-mvc/

Ayo
Thanks for the links but what I am wanting to do is get diffent register info depending on the link. Say I have two buttons, register coder and register designer, the pages will ask for different info to store in database.
dean nolan
try adding a roles column in your table and depending on the link pass that role be it a string or a number to your database along with the info they input and when saved you have access to what type of member the user is and when you authorize do a check on that column
Ayo
A: 

I got this working using sqltableprofileProvider http://www.asp.net/downloads/sandbox/table-profile-provider-samples/ This lets me have additional fields to capture at registration.

I will post more details and a tutorial in blog soon.

dean nolan
+1  A: 

Do you have a tutorial on how you managed to do this at all? I'm trying to do the same thing.

michael_kirby