Click here to Skip to main content
15,891,938 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
respected sir
i have one query about asp.net and i want a soluution for that query from you.

query:-
i make a project jobsite and and in this how nd where i use session so that when the user login in that jobsite their value will be store in session. for this u please give me the code. so that i make my project completely.
Posted
Updated 17-Apr-12 23:09pm
v2
Comments
Ed Nutting 18-Apr-12 4:23am    
Sir,
While your question is very polite and I applaud you for this, it is none the less not really a question but still much more of a demand. Session is used to track things between web page refreshes. Without a specific problem you are basically asking us to write a large chunk of your site for you. Something that not only can't be posted in an answer but is also unreasonable to expect us to do. A little research on the internet (via Google I recommend) would quickly bring up lots of information and articles (even lots on CP) about how to use session for login. I respectfully ask you therefore, to either modify your question with a less general, more specific problem or error or to post something to say you are researching the issue yourself.

Thank you very much,
Ed
Herman<T>.Instance 18-Apr-12 4:54am    
we don't do homework

1 solution

Try this one its may help to you..

login page button event use below code
C#
if (con.State == ConnectionState.Closed)
{
     con.Open();
}

SqlDataReader dr = null;
SqlCommand sqlcmd = new SqlCommand("your select query", con);
dr = sqlcmd.ExecuteReader();
if (dr.Read())
{
    Session["UserName"] = txtusername.Text;               
    dr.Dispose();
}
 
Share this answer
 
v3

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