[Mono-bugs] [Bug 78730][Nor] New - Session is not available without context (when using ajaxpro)
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Jun 29 12:53:41 EDT 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by informatique.internet at fiducial.fr.
http://bugzilla.ximian.com/show_bug.cgi?id=78730
--- shadow/78730 2006-06-29 12:53:41.000000000 -0400
+++ shadow/78730.tmp.19615 2006-06-29 12:53:41.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 78730
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com
+ReportedBy: informatique.internet at fiducial.fr
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Session is not available without context (when using ajaxpro)
+
+Description of Problem:
+If the "ProcessRequest" Method of a page is not called, the private
+_context variable of the Page is not set. A call to Page.Session (return
+_context.Session) fail!
+In MS.NET, it works.
+
+Considering that the static HttpContext.Current.Session is initialized why
+not use it?
+In Page.cs use this instead:
+
+Index: System.Web.UI/Page.cs
+===================================================================
+--- System.Web.UI/Page.cs (révision 62142)
++++ System.Web.UI/Page.cs (copie de travail)
+@@ -442,15 +442,15 @@
+ public virtual HttpSessionState Session
+ {
+ get {
+- if (_context == null)
++ if (HttpContext.Current == null)
+ throw new HttpException ("Session is not
+available without context");
+
+- if (_context.Session == null)
++ if (HttpContext.Current.Session == null)
+ throw new HttpException ("Session state can
+only be used " +
+ "when enableSessionState is
+set to true, either " +
+ "in a configuration file or
+in the Page directive.");
+
+- return _context.Session;
++ return HttpContext.Current.Session;
+ }
+ }
+
+
+Additional Information:
+
+This can be reproduced using the AjaxPro Library http://www.ajaxpro.info
+when attempting to write in the session (using Page.Session) in an ajaxpro
+method!
More information about the mono-bugs
mailing list