1

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 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

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?
0

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/

2 Comments

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

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.