Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to create a session for login. so when user login his name and logout button can be shown on the masterpage.
Posted
Comments
[no name] 11-May-12 4:48am    
please more describe ur questions...

after verify user is valid and then add
C#
session["user"]=txtuname.text;


here we create the user session with textbox of name of user.

after login and redirect successful at the master page in page_load event

C#
if(Session["user"]==""||session["user"]==null)
{
      btn_logut.visible=false;
}
else
{
   btn_logut.visible=true;
}
 
Share this answer
 
v3
Look here:
Traditional Login page design discussion[^]

Login Controls were released by Microsoft from ASp.NET 2.0, have a look at them here[^].
For, building Login Page using Login control, look:
How to: Create an ASP.NET Login Page[^]
ASP.NET Login Controls Overview[^]
How to add a Login, Roles and Profile system to an ASP.NET 2.0 [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900