Last post Oct 30, 2013 04:45 AM by Flo Stony
Oct 29, 2013 06:29 AM|Flo Stony|LINK
Maybe somebody can help me.
I have an ASP.net application "Application1" in the web.config of this application the sessionstate is configured as following:
<sessionState mode="InProc" cookieName=".COSCOOKIEMAIN" timeout="20" cookieless="AutoDetect" />
in one Directory of the Application e.g. /Subfoler1 i want to turn of session mode with following code:
<sessionState mode="Off" />
But I'm getting an error do anybody know why?
Thanks for help
Oct 29, 2013 07:50 AM|Siva Krishna Macha|LINK
Please share the error details
Oct 29, 2013 08:44 AM|Flo Stony|LINK
Parser-Error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Zeile 4: <pages validateRequest="false"></pages>
Zeile 5: <httpRuntime requestValidationMode="2.0" />
Zeile 6: <sessionState mode="Off" />
Zeile 7: </system.web>
Zeile 8: </configuration>
Oct 29, 2013 08:55 AM|PatriceSc|LINK
More likely the idea is that the session state is an application level settings. It is either turned off or on but can't be selected on a directory or page basis.
- if this actually another app, make it an application root and you should be then able to have your own settings for this other web app
- else http://msdn.microsoft.com/en-us/library/ydy4x04a(v=vs.85).aspx and EnableSessionState allows to tell which usage level you want for the session state. This particular setting
can be applied to a directory level web.config if you want to tell you don't want to use the session state for some pages that are still part of the same application.
Edit : see
http://msdn.microsoft.com/en-us/library/950xf363(v=vs.85).aspx for the web.config settings.
Oct 30, 2013 04:45 AM|Flo Stony|LINK
Thanks PatriceSc that's the solution.