|
-
Jul 10th, 2007, 09:00 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] How to check if a session variable exists. If (Session["LoggedIn"]) : C#[2005]
If I try it that way, I get can not convert to boolean. The only options I get when I type . to append a conversion does not include a conversion to boolean.
How can I check if a session variable exists before checking it's value. This causes me problems.
When I looked into convert to boolean in the MSDN. How do you read this? I don't understand it:
.NET Framework Class Library
Convert.ToBoolean Method (Boolean)
Returns the specified Boolean value; no actual conversion is performed.
[C#]
public statibool ToBoolean(
bool value
);
-
Jul 10th, 2007, 09:06 PM
#2
Thread Starter
Hyperactive Member
Re: How to check if a session variable exists. If (Session["LoggedIn"]) : C#[2005]
I tried:
if (!Session["LoggedIn"].Equals(null))
but getting not set to reference an instance of an object.
-
Jul 10th, 2007, 10:47 PM
#3
Thread Starter
Hyperactive Member
Re: How to check if a session variable exists. If (Session["LoggedIn"]) : C#[2005]
(Session["LoggedIn"]) !=null)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|