Generally, for authenticating user, we can simply use the asp.net login control, however, for this situation, you want to simulate the login status control.
For implementing this, you could try to set a status in the masterpage page_load event to replace the loginstatus control and a lgoiname session to replace the loginname control:
After you check the login user input name and password, if they are correct, you could set the Loginstatus to true, and assgin the username to loginname also.
Besides, the ASP.NET login controls provide a robust login solution for ASP.NET Web applications without requiring programming, and you could take a look at:
Member
31 Points
90 Posts
simulate login status control
Jun 01, 2014 07:31 AM|shaparak631|LINK
Hi and good day,
Im creating a login control manually
I cant use login status directly
there is a link button, I want tht when user logged in, it shows logout and when user not athenticated it shows login.
how can I?
Member
31 Points
90 Posts
Re: simulate login status control
Jun 04, 2014 03:04 AM|shaparak631|LINK
no need to answer this question, I found another solution, this was totally wrong way.
All-Star
27134 Points
2676 Posts
Re: simulate login status control
Jun 04, 2014 05:52 AM|Shawn - MSFT|LINK
Hi,
Generally, for authenticating user, we can simply use the asp.net login control, however, for this situation, you want to simulate the login status control.
For implementing this, you could try to set a status in the masterpage page_load event to replace the loginstatus control and a lgoiname session to replace the loginname control:
After you check the login user input name and password, if they are correct, you could set the Loginstatus to true, and assgin the username to loginname also.
Besides, the ASP.NET login controls provide a robust login solution for ASP.NET Web applications without requiring programming, and you could take a look at:
http://www.c-sharpcorner.com/uploadfile/raj1979/login-control-in-Asp-Net-3-5/
http://asp-net-example.blogspot.com/2008/10/loginstatus-control-example-how-to-show.html
Regards