Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Show a Name From a Session to a Label?
Posted

Are you really want this?
C#
Label1.Text=Session["name"].ToString();
 
Share this answer
 
Comments
Manjit Sidhu 13-Jun-12 7:35am    
I used this
Session["EmpName"] = Convert.ToString(Request.QueryString[1]);
lblEmployeeName.Text = Session["EmpName"].ToString;

but it shows error: Cannot Convert Method Group 'ToString' to non-delegate type 'string'.

please tell me any solution......
uspatel 13-Jun-12 7:38am    
ToString is method use parenthesis as
Session["EmpName"].ToString();
Manjit Sidhu 13-Jun-12 7:48am    
thank you for help.... and sorry for asked this type of silly mistake........
NameLabel.Text = Session ["YourName"].ToString();
 
Share this answer
 
Comments
Manjit Sidhu 13-Jun-12 7:35am    
I used this
Session["EmpName"] = Convert.ToString(Request.QueryString[1]);
lblEmployeeName.Text = Session["EmpName"].ToString;

but it shows error: Cannot Convert Method Group 'ToString' to non-delegate type 'string'.

please tell me any solution......
Anoop Ananthan 14-Jun-12 4:58am    
Your "ToString" method needs to have paranthesis or it will be treated like a delegate instead of method.

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