CompilationMode=Never & SessionState

Posted by Nariman on Stack Overflow See other posts from Stack Overflow or by Nariman
Published on 2009-12-02T21:16:24Z Indexed on 2010/04/07 21:03 UTC
Read the original article Hit count: 352

It seems that CompilationMode=Never doesn't permit Sessions to be properly wired.

It first complains that the EnbaleSessionState directive is not allowed on this page.

Explicitly assigning the System.Web.SessionState.IRequiresSessionState to the Page [1] avoids the null reference exceptions (around .Session access) but still doesn't persist or wire-up sessions correctly.

Has anyone successfully used ASP.NET Sessions with CompilationMode=Never?

Conceptually, why should these be disjoint??

[1] - http://msdn.microsoft.com/en-us/library/system.web.ui.compilationmode.aspx

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sessionstate