Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in login page im giving the username in textbox1 and in further webpages this user name is defaultly been thrown by giving Session["user"] = TextBox1.Text; in page_load funtion and in other web pages for the username textboxes in each web page i gave as
C#
if (Convert.ToString(Session["user"]) != "guest" && Convert.ToString(Session["user"]) != null) 
{ 
   txtEmail.Text = Convert.ToString(Session["user"]); 
   txtEmail.Enabled = true; 
}

i got the solution too. i had run in the local system and the username is default had thrown in other webpages but it is not running in web server...that is my problem...please help me
Posted
Updated 16-Oct-12 8:43am
v3
Comments
Sushil Mate 16-Oct-12 6:44am    
what's the error/exceptions??
lavanya19 16-Oct-12 6:46am    
i didnt get any error while i run in web browser bt i m not gettin the username displayed in web browser...bt i m able to run in my local host!
Sushil Mate 16-Oct-12 6:56am    
you need to check your server setting of session as well as config file of your website. there might be issue.
lavanya19 16-Oct-12 11:20am    
@sushil..thank u for helping me..i am a fresher m nt sure of all the concepts...u askd me to check server setting of session as well as config file of website..so,wt things hav to be correct in that web config file of website..
MT_ 16-Oct-12 7:06am    
can you show code where you are saving the value in session? probably it is not getting set !

1 solution

hi,

Do one thing in the else part write this code :-

C#
if (Convert.ToString(Session["user"]) != "guest" && Convert.ToString(Session["user"]) != null)
{
txtEmail.Text = Convert.ToString(Session["user"]);
txtEmail.Enabled = true;
}

else
{
C#
txtEmail.Text="Not Getting Email Value from session";
}


Tell me the output by doing this & post your we.config file here
 
Share this answer
 
Comments
lavanya19 16-Oct-12 23:19pm    
@adi...thanks a lot...i l do that..n let u knw

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