A
Andrea Williams
I have created an additional class to handle some session handling for a new
web application, but I'm unable to set or retrieve the session variables.
Code is below.
The problem is, I get this error when trying to compile:
'System.Web.HttpContext.Session' denotes a 'property' where a 'method' was
expected
And it blue lines the word Session in my code. I've tried several different
ways to code this with no success.
If I can't set a session variable this way in a class, how is it done? I
saw that someone else was able to do it in a post in Dec, but that didn't
work for me.
I've done several searches and have come up with nothing that has helped.
In C# Please
Here are some things I've tried:
To return a session var:
HttpContext.Current.Session("MyVar").ToString()
System.Web.HttpContext.Current.Session("MyVar").ToString()
Session("MyVar").ToString()
Thanks in Advance for any help you might give me!
Andrea
web application, but I'm unable to set or retrieve the session variables.
Code is below.
The problem is, I get this error when trying to compile:
'System.Web.HttpContext.Session' denotes a 'property' where a 'method' was
expected
And it blue lines the word Session in my code. I've tried several different
ways to code this with no success.
If I can't set a session variable this way in a class, how is it done? I
saw that someone else was able to do it in a post in Dec, but that didn't
work for me.
I've done several searches and have come up with nothing that has helped.
In C# Please
Here are some things I've tried:
To return a session var:
HttpContext.Current.Session("MyVar").ToString()
System.Web.HttpContext.Current.Session("MyVar").ToString()
Session("MyVar").ToString()
Thanks in Advance for any help you might give me!
Andrea