2008-08-29 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Fri, 29 Aug 2008 19:42:58 +0000 (19:42 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 29 Aug 2008 19:42:58 +0000 (19:42 -0000)
* HttpApplication.cs: do not cache handlers which aren't
reusable.

2008-08-29  Marek Habersack  <mhabersack@novell.com>

* HtmlHead.cs: call base.OnInit ()
If Page is null, throw an exception.

svn path=/trunk/mcs/; revision=111939

mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlHead.cs
mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpApplication.cs

index e3267d465e99a25d275f0be8d97bee6f314f3317..0b1e1b3ebe35c6a1f3a26d25f80ef6ee7c4e1ffe 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-29  Marek Habersack  <mhabersack@novell.com>
+
+       * HtmlHead.cs: call base.OnInit ()
+       If Page is null, throw an exception.
+
 2008-07-25  Dean Brettle <dean@brettle.com>
 
        * HtmlControl.cs (PreProcessRelativeReference), 
index 5c70c6b11c363c379587d05761f9ed3870d20506..36f5c39836fa227c44283cb1b934d08aa57f3e13 100644 (file)
@@ -54,10 +54,16 @@ namespace System.Web.UI.HtmlControls
                
                protected internal override void OnInit (EventArgs e)
                {
+                       base.OnInit (e);
+                       Page page = Page;
+                       
+                       if (page == null)
+                               throw new HttpException ("The <head runat=\"server\"> control requires a page.");
+                       
                        //You can only have one <head runat="server"> control on a page.
-                       if(Page.Header!=null)
+                       if(page.Header != null)
                                throw new HttpException ("You can only have one <head runat=\"server\"> control on a page.");
-                       Page.SetHeader (this);
+                       page.SetHeader (this);
                }
                
                protected internal override void RenderChildren (HtmlTextWriter writer)
index bb5436f9601c682c4c3bc40a17deb61613db1699..072249dfcbb3b5f2d110be5688dcf860a431f756 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-29  Marek Habersack  <mhabersack@novell.com>
+
+       * HttpApplication.cs: do not cache handlers which aren't
+       reusable.
+
 2008-08-20  Marek Habersack  <mhabersack@novell.com>
 
        * HttpResponseHeader.cs: encode header values if
index 272481def4911895f6ffaf7bdbb303dcb6b1d070..c380e1ceab8a8993bb81e1486d3af7fb415aef9e 100644 (file)
@@ -1477,7 +1477,7 @@ namespace System.Web {
                        cache.Clear ();
                }
                
-               internal object LocateHandler (string verb, string url)
+               object LocateHandler (string verb, string url)
                {
                        Hashtable cache = GetHandlerCache ();
                        string id = String.Concat (verb, url);
@@ -1494,7 +1494,10 @@ namespace System.Web {
                        ret = factory_config.LocateHandler (verb, url);
 #endif
 
-                       cache [id] = ret;
+                       IHttpHandler handler = ret as IHttpHandler;
+                       if (handler != null && handler.IsReusable)
+                               cache [id] = ret;
+                       
                        return ret;
                }