Click here to Skip to main content
15,905,874 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
SQL
In an aspx page There is the code :
Session["Value"].ToString() == ""
But this session is not declared. How does it work?
Posted

1 solution

if(Session["Value"]!=null)
{
  string abc=Session["Value"].ToString();
}
else
{
}
 
Share this answer
 
v3
Comments
Sumon562 7-Jul-13 1:14am    
When I will debug what this line "string abc=Session["Value"].ToString();" shows !!! Please describe..
Zafar A khan 7-Jul-13 1:50am    
this will show the value stored in session
if session is not initialized the "else" part will get execution
Thomas Daniels 7-Jul-13 12:46pm    
Good answer, +5!

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