开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜