开发者

createuserwizard adding roles to users

开发者 https://www.devze.com 2023-01-16 22:29 出处:网络
Hi I have a createuserwizard controls and I would like assign ROLES when creating a user. Any idea how to do it? Thanks

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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消