how to set default role for new members

Hi All

I have a website using asp membership. When a new user signs up, they are not automatically assigned to a role. What would be the simplest approach to assigning any new member to the "Registered" role? What if  I wanted the role to be "Members" instead of "Registered"?

 Thanks

Richard

0
RMcBride
4/29/2009 3:46:33 AM
asp.net.security 27051 articles. 1 followers. Follow

4 Replies
398 Views

Similar Articles

[PageSpeed] 25

In the CreatedUser event of the CreatedUserWizard, you can do something like:

Roles.AddUserToRole(CreateUserWizard1.UserName, "Members")


Patrick Oliveros
Web Developer - Emerson Electric Asia, Ltd. - ROHQ
webthinker.wordpress.com
0
jpcoliveros
4/29/2009 5:33:47 AM

 In the button click event u need to write like this

Roles.AdduserToRole(txtuser.Text,"Nonadmin");

0
anup1252000
4/29/2009 7:45:31 AM
Hi all

As you might guess, I am using the asp wizard to create the user. I can't seem to find where it exposes the createuser event. Any help with that?

Thanks

Richard
0
RMcBride
4/29/2009 3:01:06 PM
Never mind. Fingers typing before brain working.

Thanks

Richard
0
RMcBride
4/29/2009 3:03:54 PM
Reply:

Similar Artilces:

How to set a default role for new users?
Sorry if this question has been asked before but I was unable to find it. How do I assing a default role like "guest" to new users? I am using the CreateUserWizard to let new members enter their information. If you look at the starter kits, (like the club starter kit) they automatically create the roles in the global.asax file in case they are not there. Then, in the createuserwizard's "CreatedUser" event, you add code that assigns the role to the current user. something like: Roles.AddUserToRole(CreateUserWizard1.UserName, AvailableRoles.Items[i].Value);    http://weblogs...

How is the default Role for a new registered user set?
I've been digging through the C# Personal Site Starter Kit code, and I cant seem to figure out how it assigns roles to new users. How is this determined?And how would one configure this?thanks It doesn't add roles to users, you do. Go to the file menu in VWD and select Website -> ASP.NET Configuration. You will then be presented with a web site where you can add roles, users, approve users, and add users to roles. Alternatively you can add some code to the registration page that adds the registered users to the "Friends" role. You will have to set the CreateUserWizard property of "Dis...

Set default settings for new users
I don't know if this is even possible, but here goes. I have about 5 users for our desktop computer, 1 adult, 3 kids and me (I don't count as an adult :P). There are some settings I want to have each of the environments default to, where they can then change them as they wish on their own. Instead of setting them one-at-a-time, is there a way to modify the settings on the template of what goes into a user's /home directory when they are created? Examples: Set it so when I add a person to the system their - default browser is set to Firefox - starting home ...

How to Set VWD 2008 Express Default .Net Framework Target for New Sites
I'd like to be able to tell VWD 2008 Express that the default target framework for new websites should be 2.0 Currently when I try to start a new website the only option is 3.5.  Someone showed me how to get to the property pages for a new site and THEN change it.  But I'd like to have it build for 2.0 from the very beginning for EVERY new site. Anyone know how to do this? Thanks in advance!-- the right relationship is everything -- Whe you do File | New | Web site, there is a dropdown on top of the dialog that allows you to select target framework for the new site.Tha...

Creating User Account Without Default Security Role (Registered User Role)
  My DNN version is 3.1.1. The portal is set to Private Registration. Unauthenicated users have access to the basic pages of the site. We require my company's current customers to register and be approved to have access to all other pages that contain information restricted to them (the major part of the site). As you know, authorizing a user account applys the Registered User security role by default and this is how I control access to the customer areas.  We want to create a page that will be used by Marketing to allow potential customers by login to...

Setting a default role
Hi everyone, Using the Asp.net 1.4 Portal Starter kit, I am trying to, upon registering, assign a role to the user which is not the portals default "all users". This may not be a hard task , but I am pretty new to this and would appreciate any help thank you Mark Hollas PS: if anyone has had any experience with using PayPal subscription button together with the Portals registration, could you point me in the right direction as to how to make the PayPal button act as the registration button, then pass the form information to the portal database upon PayPals IPN return? Thanks again. M...

How to set Default Role
I Have 2 Roles in my web Site.... Admins and NormalUser, how can i set "NormalUser" as default role for new users I don't want to place newly created users in Admins.Thanx in Advance... in your script section:       Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs)        Roles.AddUserToRole(CreateUserWizard1.UserName, "NormalUser")    End Suband in your wizard::<asp:CreateUserWizard                 ...

Understanding the Security Implication of Active Directory Default Settings Part II of An Audit of Active Directory Security
http://www.securityfocus.com/focus/microsoft/aads2.html -- Regard: Joh@nnes� 1216771 Ont.Inc. "Nothing is more damaging to a new truth than an old error" ...

Duplicate Security Roles Showing up In Security Roles Manager
Anyone have any ideas?  We have had and instance of 3.0.13 with one child portal running for about a month now.  A few days ago our adminstrator noticed that we have duplicate entries for security roles. For example, the Security Roles Manager shows:Name Description Fee Every Period Trial Every Period Public Auto   Administrators Portal Administration         False False   Administrators Portal Administration         False False  Registered Users Registered Users    &n...

After migration from .Net 1.1 to .Net 3.5 do I have to incorporate new web.config settings in old *.config file
Hi,I have successfully migrated web application from .Net 1.1 to .Net 3.5. Could you let me know whether I have to incorporate setting in new web.config (this new web.config file was generated automatically due to migration) into old *.config file?FYI: Old *.config file contains all application level settings required. So I will continue to use old.config file by removing new web.config file. Settings which are in new web.config file are:<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses asp.net 1.1, i also have a new app that use ASP.net 2.0.  how can i set my new .NET 2.0 app to point to asp.net 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

setting a default role for a user
Is it possible to set a default role for someone once they've filled in the form from the create user wizard? For instance if once you successfully entered all the data and clicked the buttob your default role would be  set to user.'user'. If so, how can I accomplish this. Also I am using VS 2005 to build the website and I am using the MySql Membership providers. Hi Sojan, Use the Created User Event of CreateUserWizard and assign newly created user to "User" Role protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)    &nb...

Default security settings too open
Name: Norman Shulman Product: Firefox Summary: Default security settings too open Comments: The default security setting is to show no warning messages. Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.1b4) Gecko/20090423 Firefox/3.5b4 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Security
I am looking for some info on how I can set a role after login. What I want to do is set the user to a different role after they have logged into the app. I tried doing a set role, but PB gives me an illegal datatype: set error. Help anyone?? Thanks set role test_admin identified by password; ls_sql = 'set role test_admin identified by password' execute immediate :ls_sql using sqlca; The role must have already have been assigned to the user as a non-default role. -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. MySybase http://my.syb...

Web resources about - how to set default role for new members - asp.net.security

Default logic - Wikipedia, the free encyclopedia
Default logic is a non-monotonic logic proposed by Raymond Reiter to formalize reasoning with default assumptions. Default logic can express ...

Privacy Setting For New Facebook Users Aged 13-17 Now Defaults To ‘Friends’
Facebook is changing the initial default privacy setting for users aged 13 through 17 to friends, from friends of friends, but those teen users ...

Secure browsing by default
We now use https by default for all Facebook users. This feature, which we first introduced as an option two years ago , means that your browser ...

北方理財團隊的家園:http://group.hexun.com/m132312/default.html外汇交易员芬芳fenfang恭候您! - 芬芳FENFANG - 和讯博客
北方理財團隊的家園:http://group.hexun.com/m132312/default.html外汇交易员芬芳fenfang恭候您! - 芬芳FENFANG - 芬芳FENFANG的博客 - 和讯博客

Facebook changes default privacy settings for new users to friends-only
Facebook announced today a shift in privacy settings for new users. Now, when someone signs up for a profile, their default posting status is ...


Google AdSense Ads Scrolling Now Default? - Flickr - Photo Sharing!
More at www.seroundtable.com/archives/016753.html

Sen. Rand Paul on Debt Default - YouTube
Sen. Rand Paul on Debt Default - YouTube

Local bourse will suffer if US defaults
The picture is a worrying one for Australian investors if the impasse with the US debt ceiling is not resolved by the Thursday deadline.

Readdle’s Spark email app gets even better with default signatures and other enhancements
... further cementing its reputation as an excellent alternative to Apple's built-in Mail app and to any other third-party email app on iOS. Default ...

Resources last updated: 1/17/2016 1:23:54 PM