A
Axel Dahmen
Hi,
I've added a property to my Page base class (this base class inherits from
Page and all my aspx.cs classes inherit from my base class). This property
of mine uses the Session object to determine its return information.
After implementing this property, whenever I now open any aspx page in the
Visual Studio 7.0 IDE, the following error shows up:
"The file failed to load in the Web form designer. Please correct the
following error, then load it again: Property accessor 'myProp' on object
'myPage' threw the following exception: 'Session state can only be used when
enableSessionState is set to true, either in configuration file or in the
Page directive'"
I've read some older newsgroup articles from Google
(http://groups.google.de/groups?q=EnableSessionState+property+Session+design
er&ie=UTF-8), but none contained helpful tips.
In fact my configuration is perfectly alright. Adding "EnableSessionState"
to the Page directive doesn't help and seems unnecessary to me anyway as
'true' is the default for that parameter.
It appears to be a Visual Studio quirk, doesn't it?
TIA,
Axel Dahmen
Here's an example of some implementation like mine:
public class myPage : System.Web.UI.Page
{
public string myProp {get {return
Session["anything"].ToString();}}
}
I've added a property to my Page base class (this base class inherits from
Page and all my aspx.cs classes inherit from my base class). This property
of mine uses the Session object to determine its return information.
After implementing this property, whenever I now open any aspx page in the
Visual Studio 7.0 IDE, the following error shows up:
"The file failed to load in the Web form designer. Please correct the
following error, then load it again: Property accessor 'myProp' on object
'myPage' threw the following exception: 'Session state can only be used when
enableSessionState is set to true, either in configuration file or in the
Page directive'"
I've read some older newsgroup articles from Google
(http://groups.google.de/groups?q=EnableSessionState+property+Session+design
er&ie=UTF-8), but none contained helpful tips.
In fact my configuration is perfectly alright. Adding "EnableSessionState"
to the Page directive doesn't help and seems unnecessary to me anyway as
'true' is the default for that parameter.
It appears to be a Visual Studio quirk, doesn't it?
TIA,
Axel Dahmen
Here's an example of some implementation like mine:
public class myPage : System.Web.UI.Page
{
public string myProp {get {return
Session["anything"].ToString();}}
}