createuserwizard adding roles to users
Hi I have a createuserwizard controls and I would like assign ROLES when creating a user.
Any idea how to do it? Thanks
Here my code C#
<asp:CreateUserWizard ID="uxCreateUserWizardInput" runat="server"
LoginCreatedUser="False">
<WizardSteps>
开发者_高级运维 <asp:CreateUserWizardStep runat="server" />
<asp:CompleteWizardStep runat="server" />
</WizardSteps>
</asp:CreateUserWizard>
I found out answer to my questions here http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx
In case anyone was wondering, after the user is created you can simply make this call:
Roles.AddUserToRole("UserName", "Role");
This does of course assume you are using a correctly configured role provider :)
精彩评论