M
^MisterJingo^
Hi all,
I've been searching the net for a way to programatically add a user to
a role on successful registration. Not finding anything useful I
decided to experiment and came up with the following. Using the
SQLprovider for membership/roles and the createUserWizard:
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs
e)
{
Roles.AddUserToRole(CreateUserWizard1.UserName, "User");
}
This seems to work fine, but wanted to check if it was ok to do it
this way.
Thanks.
I've been searching the net for a way to programatically add a user to
a role on successful registration. Not finding anything useful I
decided to experiment and came up with the following. Using the
SQLprovider for membership/roles and the createUserWizard:
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs
e)
{
Roles.AddUserToRole(CreateUserWizard1.UserName, "User");
}
This seems to work fine, but wanted to check if it was ok to do it
this way.
Thanks.