Problem with Login control of ASP.NET

后端 未结 13 1079
春和景丽
春和景丽 2021-01-03 00:38

I set up a website to use SqlMembershipProvider as written on this page.

I followed every step. I have the database, I modified the Web.config to use this provider,

相关标签:
13条回答
  • 2021-01-03 01:29

    I have checked the code over in the files you have sent me (thanks again for sending them through).

    Note: I have not tested this since I have not installed the database etc..

    However, I am pretty sure this is the issue.

    You need to set the MembershipProvider Property for your ASP.NET controls. Making the definitions for them:

    <asp:Login ID="Login1" runat="server" 
        MembershipProvider="MySqlMembershipProvider">
        <LayoutTemplate>
            <!-- template code snipped for brevity -->
        </LayoutTemplate>
    </asp:Login>
    

    And..

    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
        MembershipProvider="MySqlMembershipProvider">
            <WizardSteps>
                <asp:CreateUserWizardStep runat="server" />
                <asp:CompleteWizardStep runat="server" />
            </WizardSteps>
        </asp:CreateUserWizard>
    

    This then binds the controls to the Membership Provider with the given name (which you have specified in the Web.Config.

    Give this a whirl in your solution and let me know how you get on. I hope this works for you :)

    Edit

    I should also add, I know you shouldn't need to do this as the default provider is set, but I have had problems in the past with this.. I ended up setting them all to manual and all worked fine.

    0 讨论(0)
提交回复
热议问题