I have a login page that is working. I have a create user wizard that i have configured to register to a database that i have moved onto SQL server Management Studio. That is working. But the login function is not.
please see my web.config. could anyone tell me where iam going wrong please.
the connection string i am using is localsqlserver.
What do you mean by login page is working and login function is not? Which part is not working? Can you post your relevant code here (if the login is not working then part of the code that allows users to login).
What do you mean by login tool - is it the asp.net login control? Showing just your web.config will not help us in factoring why the login does not work.
masterdineen
Member
22 Points
215 Posts
Login tool not working
Nov 12, 2012 08:29 PM|LINK
I have a login page that is working. I have a create user wizard that i have configured to register to a database that i have moved onto SQL server Management Studio. That is working. But the login function is not.
please see my web.config. could anyone tell me where iam going wrong please.
the connection string i am using is localsqlserver.
<?xml version="1.0"?> <configuration> <connectionStrings> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString="data source = ROBPC\SQLEXPRESS; Initial Catalog = DBname; Trusted_Connection=True" providerName="System.Data.SqlClient"/> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/> <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> </authentication> <membership> <providers> <clear/> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/> </providers> </membership> <profile> <providers> <clear/> <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/"/> </providers> </profile> <roleManager enabled="true"> <providers> <clear/> <add connectionStringName="LocalSqlServer" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/> <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/> </providers> </roleManager> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> <system.net> <mailSettings> <smtp from="Domain Name"> <network host="smtp.gmail.com" password="xxxxxx" port="587" userName="emailAddress"/> </smtp> </mailSettings> </system.net> </configuration>Regards
Rob
codeasp
Star
14735 Points
2545 Posts
Re: Login tool not working
Nov 13, 2012 01:45 AM|LINK
What do you mean by login page is working and login function is not? Which part is not working? Can you post your relevant code here (if the login is not working then part of the code that allows users to login).
masterdineen
Member
22 Points
215 Posts
Re: Login tool not working
Nov 13, 2012 05:54 AM|LINK
codeasp
Star
14735 Points
2545 Posts
Re: Login tool not working
Nov 13, 2012 10:34 PM|LINK
What do you mean by login tool - is it the asp.net login control? Showing just your web.config will not help us in factoring why the login does not work.
masterdineen
Member
22 Points
215 Posts
Re: Login tool not working
Nov 14, 2012 09:58 PM|LINK
please see my aspx code below.
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <style type="text/css"> .style22 { width: 100%; } .style23 { text-align: center; } </style> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server"> <table class="style22"> <tr> <td align="center" class="style23"> </td> <td align="center" atomicselection="False" class="style23" colspan="2"> <br /> <br /> <asp:Login ID="Login1" runat="server" style="margin-left: 487px"> <LayoutTemplate> <table cellpadding="1" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table cellpadding="0"> <tr> <td align="center" colspan="2"> Log In</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Email:</asp:Label> </td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> </td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="147px"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2"> <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." /> </td> </tr> <tr> <td align="center" colspan="2" style="color:Red;"> <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="Login1" /> </td> </tr> </table> </td> </tr> </table> </LayoutTemplate> </asp:Login> </td> <td align="center" class="style23"> </td> </tr> <tr> <td align="center" class="style23"> </td> <td align="center" atomicselection="False" class="style23"> </td> <td align="center" atomicselection="False" class="style23"> </td> <td align="center" class="style23"> </td> </tr> <tr> <td align="center" class="style23"> </td> <td align="center" atomicselection="False" class="style23"> Job Seeker<br /> <asp:Button ID="Button1" runat="server" Text="Register" /> </td> <td align="center" atomicselection="False" class="style23"> Recruiter<br /> <asp:Button ID="Button2" runat="server" Text="Register" /> </td> <td align="center" class="style23"> </td> </tr> </table> </asp:Content>codeasp
Star
14735 Points
2545 Posts
Re: Login tool not working
Nov 15, 2012 06:20 PM|LINK
Use the Login controls event handlers to see why the code is not working. Example of the events
This way you will be able to debug and see why the login is not working.masterdineen
Member
22 Points
215 Posts
Re: Login tool not working
Nov 25, 2012 08:24 PM|LINK
I am a little confused what to do with the event handlers.
when i select the dropdown button within propertires pane on either OnLoggingIn or OnLoginError there is nothing to select.
am i looking in the wrong place.?
masterdineen
Member
22 Points
215 Posts
Re: Login tool not working
Nov 25, 2012 08:58 PM|LINK
also..
I am able to register users, but unable to login users in.
Chen Yu - MS...
All-Star
21584 Points
2493 Posts
Microsoft
Re: Login tool not working
Nov 27, 2012 06:51 AM|LINK
Hi,
Use OnLoggingIn or OnLoginError in your login control, you could find them there.
You could reference on below article to use login control.
Please see: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.login(v=vs.100).aspx
Best Regards,
Feedback to us
Develop and promote your apps in Windows Store