Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi All,

I made a simple login system in desktop applications.

I am new in web. I want to make asp login system where user can login and logout in asp.net using C#.


I think this can done using sessions. But no idea on this.

Can anyone suggest me a good articles on this..
Thanks in Advance.
Posted
Updated 4-Jul-11 2:23am
v3

To set some value in Session,
you just have to write:>
Session["anyName"]="any Value";

By doing this, you will store the string "any Value" in your Session variable named "anyName".

When you want to retrieve that value, you just have to write:>
string variable="";
if (Session["anyName"]!=null)
variable = Session["anyName"].ToString();


To Login, you check whether :>
if(Session["anyName"]!=null)
{.
.
.
.
...
}else
Response.Redirect("Login.aspx");

And so.on...
 
Share this answer
 
In asp.net web LogIn, LogOut, Create User, Password recovery is built in features. you just drug n drop the control and configure it that it. try this link for how to use this control

http://msdn.microsoft.com/en-us/library/ms998347.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178329.aspx[^]
http://msdn.microsoft.com/en-us/library/system.web.security.membership.aspx[^]
http://msdn.microsoft.com/en-us/library/aa479008.aspx[^]
http://msdn.microsoft.com/en-us/library/ms178329(VS.85).aspx[^]

or you can write raw code for login


Thanks
 
Share this answer
 
Comments
[no name] 4-Jul-11 8:24am    
Good Call.My 5 too.
Use ASP.net built in Login Control its easy to use. For further tutorial refer some book or see on youtube, here you will find ASP.Net Login control tutorial

You can also use Session.
But the best and secure is ASP.Net Login Control
 
Share this answer
 
 
Share this answer
 
Comments
[no name] 4-Jul-11 8:24am    
Nice Links.
Uday P.Singh 4-Jul-11 10:55am    
thanks but not rated? :(
hi,

Use form authentication method in this way you can handle this login and logout eazily
 
Share this answer
 
v2

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