Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 03, 2012 09:57 AM by oned_gk
Participant
1182 Points
1697 Posts
Nov 29, 2012 06:15 AM|LINK
hi all,
I am using asp Login Control, its working fine. Please let me know how to use "remember me next time " function for this control.
below is my code
aspx >>>>>>>>>>> <asp:Login ID="Login1" runat="server" onauthenticate="Login1_Authenticate" BackColor="#FFFF99" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="10pt" Height="150px" TitleText="" Width="300px" > <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> </asp:Login> code file >>>>>>>>>>>>>>>>>>>>> protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { Business_Logic bal = new Business_Logic(); bool res = bal.Get_Login(Login1.UserName, Login1.Password); if (res) { DataTable dt = new DataTable(); dt = bal.Get_User_Info(Login1.UserName); Response.Redirect("Welcome.aspx"); } else { Response.Redirect("Login.aspx"); } }
thanks
All-Star
30969 Points
6338 Posts
Nov 29, 2012 06:44 AM|LINK
I use very simple login and work fine
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { Business_Logic bal = new Business_Logic(); bool res = bal.Get_Login(Login1.UserName, Login1.Password); if (res) { FormsAuthentication.RedirectFromLoginPage(Login.UserName, Login1.RememberMeSet); } else { e.Authenticated = false; } }
Set welcome.aspx as defaulturl in web.config
42884 Points
7019 Posts
MVP
Dec 01, 2012 11:03 AM|LINK
Hello,
Set RememberMeSet property to True in your asp:Login control. Like below,
<asp:Login ID="Login1" runat="server" RememberMeSet="True" onauthenticate="Login1_Authenticate" BackColor="#FFFF99" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="10pt" Height="150px" TitleText="" Width="300px" >
If the browser supports to save cookies, then it will save username along with the password. Remember that it will not work if the browser is configured to NOT to save cookies from websites (Which is a very rare setting actually)
Please 'Mark as Answer' if this post helps you.
Dec 03, 2012 04:46 AM|LINK
I tried this solution,
http://support.microsoft.com/kb/196955
but still no success :(
Dec 03, 2012 07:18 AM|LINK
Try my code above
WEB.CONFIG
<authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="10080" defaultUrl="welcome.aspx"/> </authentication>
login with rememberme checkbox checked. Exit browser and open again.
check you are loged in or not using loginname control
<asp:LoginName ID="LoginName1" runat="server" />
and login/logout using
<asp:LoginStatus ID="LoginStatus1" runat="server" />
Dec 03, 2012 09:27 AM|LINK
oned_gk <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="10080" defaultUrl="welcome.aspx"/> </authentication>
I did the same but still not working....
Dec 03, 2012 09:57 AM|LINK
demoninside9
Participant
1182 Points
1697 Posts
remember me next time is not working : Login Control
Nov 29, 2012 06:15 AM|LINK
hi all,
I am using asp Login Control, its working fine. Please let me know how to use "remember me next time " function for this control.
below is my code
aspx >>>>>>>>>>> <asp:Login ID="Login1" runat="server" onauthenticate="Login1_Authenticate" BackColor="#FFFF99" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="10pt" Height="150px" TitleText="" Width="300px" > <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> </asp:Login> code file >>>>>>>>>>>>>>>>>>>>> protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { Business_Logic bal = new Business_Logic(); bool res = bal.Get_Login(Login1.UserName, Login1.Password); if (res) { DataTable dt = new DataTable(); dt = bal.Get_User_Info(Login1.UserName); Response.Redirect("Welcome.aspx"); } else { Response.Redirect("Login.aspx"); } }thanks
oned_gk
All-Star
30969 Points
6338 Posts
Re: remember me next time is not working : Login Control
Nov 29, 2012 06:44 AM|LINK
I use very simple login and work fine
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { Business_Logic bal = new Business_Logic(); bool res = bal.Get_Login(Login1.UserName, Login1.Password); if (res) { FormsAuthentication.RedirectFromLoginPage(Login.UserName, Login1.RememberMeSet); } else { e.Authenticated = false; } }Set welcome.aspx as defaulturl in web.config
Ruchira
All-Star
42884 Points
7019 Posts
MVP
Re: remember me next time is not working : Login Control
Dec 01, 2012 11:03 AM|LINK
Hello,
Set RememberMeSet property to True in your asp:Login control. Like below,
<asp:Login ID="Login1" runat="server" RememberMeSet="True" onauthenticate="Login1_Authenticate" BackColor="#FFFF99" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="10pt" Height="150px" TitleText="" Width="300px" >If the browser supports to save cookies, then it will save username along with the password. Remember that it will not work if the browser is configured to NOT to save cookies from websites (Which is a very rare setting actually)
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.demoninside9
Participant
1182 Points
1697 Posts
Re: remember me next time is not working : Login Control
Dec 03, 2012 04:46 AM|LINK
I tried this solution,
http://support.microsoft.com/kb/196955
but still no success :(
oned_gk
All-Star
30969 Points
6338 Posts
Re: remember me next time is not working : Login Control
Dec 03, 2012 07:18 AM|LINK
Try my code above
WEB.CONFIG
login with rememberme checkbox checked. Exit browser and open again.
check you are loged in or not using loginname control
and login/logout using
demoninside9
Participant
1182 Points
1697 Posts
Re: remember me next time is not working : Login Control
Dec 03, 2012 09:27 AM|LINK
I did the same but still not working....
oned_gk
All-Star
30969 Points
6338 Posts
Re: remember me next time is not working : Login Control
Dec 03, 2012 09:57 AM|LINK