Hello, Here is a patch for the Page object, so that it behaves more like Microsoft's implementation. This is useful when some guy write things like: class Client : Page {} in order to be able to use the Session in its Client class, without thinking about HttpContext.Current. Jb

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 45303)
+++ ChangeLog   (working copy)
@@ -1,3 +1,7 @@
+2005-06-01  Jb Evain  <[EMAIL PROTECTED]>
+
+       * Page.cs: Ensure that the context is setted before accessing the 
Session.
+
 2005-05-26 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * AttributeCollection.cs: html-encode attribute values. Fixes
Index: Page.cs
===================================================================
--- Page.cs     (revision 45303)
+++ Page.cs     (working copy)
@@ -364,12 +364,12 @@
        public virtual HttpSessionState Session
        {
                get {
-                       if (_context.Session == null)
+                       if (Context.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 Context.Session;
                }
        }
 
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to