Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 31, 2012 05:47 AM by geniusvishal
Dec 30, 2012 08:12 PM|LINK
I have a website with createuserwizard and with some roles. I have several roles and one of them is "Users". What I want is when a person creates a new account using the create user wizard I want it to give this account "Users" role automatically. How can
I do that?
I am waiting for your answers
Have a great day!
Dec 30, 2012 08:40 PM|LINK
In your global.asax.cs file add a function like this:
ctx = HttpContext.Current;
( ctx.Request.IsAuthenticated )
roles = LookupRolesForUser( ctx.User.Identity.Name );
newUser = new
ctx.User.Identity, roles );
Of course the LookupRolesForUser function is one that you'll have to write.
This is one step that is the same for both ASP.Net and MVC.
Dec 31, 2012 05:47 AM|LINK
Hi Mac.. Please go through the articles and threads: