W
Will
ok.. I've created a namespace and a class in an assembly
file and included into my .aspx page as a custom control.
On that aspx page I store a string in a session as follows:
Session["strColor"] = "blue";
Now, inside my assembly file I want to retrieve that
variable. I have tried everything.. I have an instance of
the current session state as follows:
HttpSessionState mySession = ((HttpSessionState)
HttpContext.Current.Session);
now when I try to do something like:
private string strTemp = mySession["strColor"].ToString();
I get the follwing error:
A field initializer cannot reference the nostatic field,
method, or property 'myNamespace.myClass.mySession'
What does this error mean? And how can I retrieve
strColor? I have seriously tried a thousand things..
please be specific in your answers, thanks A LOT in
advance.
Will
file and included into my .aspx page as a custom control.
On that aspx page I store a string in a session as follows:
Session["strColor"] = "blue";
Now, inside my assembly file I want to retrieve that
variable. I have tried everything.. I have an instance of
the current session state as follows:
HttpSessionState mySession = ((HttpSessionState)
HttpContext.Current.Session);
now when I try to do something like:
private string strTemp = mySession["strColor"].ToString();
I get the follwing error:
A field initializer cannot reference the nostatic field,
method, or property 'myNamespace.myClass.mySession'
What does this error mean? And how can I retrieve
strColor? I have seriously tried a thousand things..
please be specific in your answers, thanks A LOT in
advance.
Will