Micro optimization - don't call Page twice
authorMarek Habersack <grendel@twistedcode.net>
Wed, 15 Apr 2009 07:19:42 +0000 (07:19 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 15 Apr 2009 07:19:42 +0000 (07:19 -0000)
svn path=/trunk/mcs/; revision=131734

mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs

index 3c4668c040ffa72300cf92dd1a013c29ff7beb63..25c2ec43fb91a86c9c7774ac77c232a9a80686b5 100644 (file)
@@ -111,8 +111,9 @@ namespace System.Web.UI.HtmlControls {
 #if NET_2_0
                protected internal override void Render (HtmlTextWriter writer)
                {
-                       if (Page != null)
-                               Page.ClientScript.RegisterForEventValidation (UniqueID);
+                       Page page = Page;
+                       if (page != null)
+                               page.ClientScript.RegisterForEventValidation (UniqueID);
                        base.Render (writer);
                }
 #endif