Click here to Skip to main content
15,878,871 members
Please Sign up or sign in to vote.
1.91/5 (4 votes)
See more:
I am new to ASP .net C#
i created registration,login and member profile page

after all validations data is stored in database..
and login page also working fine...

i dont know about sessions ..how can i create session and how to make login module more effective using sessions?

thanks in advance
Posted

at login you can use this

Session["username"]=usernametxt.Text;//or assign it from dataset


For more info on session check this[^]
 
Share this answer
 
v2
Comments
[no name] 9-Aug-11 4:14am    
How can i check in registration page and login page ?
Syed Salman Raza Zaidi 10-Aug-11 2:01am    
after login you can check on any page like, if(Session["username"].toString() !== "")
[no name] 10-Jun-13 7:03am    
dont use Session["username"].toString() as it doesnt handle null values you might face "object reference not set .." exception.

always use Convert.toString() for this kind of scenario.
Thank you,I am running the project immoderately asking userid and pwd i am enter the details its checking backed database it's correct disply that corresponding some another page,it's wrong display error msg.

My question is ia m running the first time asking login details ok,I am running second time not asking again login details automatically display that corresponding page,
can you give me one simple example on this plz help me what concept is involved to do this?????
 
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