I added a create user and login control wizard to my asp website and attached the database from a previously working solution. But when I try to login with a successfully created user I can't login.
My question is am I missing a step in configuring the login control? I know that it uses the default membership provider but do I need to configure it to recognise the database?
This is the login control declaration:
<asp:Login ID="Login1" runat="server" DestinationPageUrl="Home.aspx" FailureAction="RedirectToLoginPage" Height="161px" Width="450px" OnAuthenticate="Login1_Authenticate1" BackColor="#EFF3FB" BorderColor="#B5C7DE" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333">
<InstructionTextStyle Font-Italic="True" ForeColor="Black" />
<LoginButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" />
<TextBoxStyle Font-Size="0.8em" />
<TitleTextStyle BackColor="#507CD1" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
</asp:Login>
And the web.config:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<roleManager enabled="true" />
<authentication mode="Forms" />
<compilation debug="true" targetFramework="4.0"/>
</system.web>
</configuration>
It sounds like the connectionString to the Membership database is working, but you may be providing an invalid username or password . You can debug this further by implementing the OnAuthenticate Event :
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login.authenticate(v=vs.100).aspx
You might also consider just creating a new User and test logging in with the new username and password vai the Membership.CreateUser method:
http://msdn.microsoft.com/en-us/library/t8yy6w3h(v=vs.100).aspx
Please refer this hope this will help
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.