Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i add the true in Session["Permission"] as true is bool
Posted

You can use this statement

C#
Session["Permission"] = true


to access use this

C#
bool permsn=convert.toBoolean(Session["Permission"] )
 
Share this answer
 
v2
Comments
Pravin Patil, Mumbai 5-Oct-11 7:53am    
Straight to the point....
My 5..
P.Salini 5-Oct-11 8:00am    
Cheers!
Use this one
session["Permission"]=true;
 
Share this answer
 
v2
Comments
Pravin Patil, Mumbai 5-Oct-11 7:54am    
Correct but Codehelper_PS has given the way to read the value as well...
C#
bool b=true;
Session["Permission"]=b.ToString()


and when retive from session then use bool.parse();
 
Share this answer
 
v2

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