?
Solved

Configuring membership wizard to assign specific role when account is created in ASP 2.0

Posted on 2007-11-19
5
Medium Priority
?
347 Views
Last Modified: 2013-12-17
I have a site with 3 membership roles  admin, management, and user.  I’m using ASP.Net 2.0.  Can someone direct me,  to a tutorial that will show me how to configure the membership wizard so it will set all new members to the user role only? Or show me how I can do this?

Thanks for any help!
0
Comment
Question by:bmanmike39
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:Mortaza Doulaty
ID: 20317944
You can add user to role using:

Roles.AddUserToRole("username","rolename")

You can use this code in the events of user created.
0
 
LVL 27

Accepted Solution

by:
Sammy Ageil earned 2000 total points
ID: 20318318
0
 
LVL 27

Assisted Solution

by:Sammy Ageil
Sammy Ageil earned 2000 total points
ID: 20318337
you should always check if the user exists in this role before adding them
you can do that by checking if the UserIsInRole which is a method you can  override IsUserInRole(string username, string rolename) the method should return a bool value of course
more on the method and an example implementation can be found here

http://msdn2.microsoft.com/en-us/library/system.web.security.roleprovider.isuserinrole(vs.80).aspx
0
 
LVL 12

Expert Comment

by:Mortaza Doulaty
ID: 21123820
>>Split: Mortaza_doulaty {http:#20317944} & sammy1971 {http:#20318318}
So where are my points?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question