Author: andrews Date: 2006-05-25 03:39:34 -0400 (Thu, 25 May 2006) New Revision: 61098
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog trunk/mcs/class/System.Web/System.Web.UI/Control.cs trunk/mcs/class/System.Web/System.Web.UI/Page.cs Log: Fix the order of OnInit invocation of controls created via master page content (see http://lists.ximian.com/pipermail/mono-devel-list/2006-May/018585.html ). Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-05-25 00:03:32 UTC (rev 61097) +++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-05-25 07:39:34 UTC (rev 61098) @@ -1,3 +1,9 @@ +2006-05-25 Andrew Skiba <[EMAIL PROTECTED]> + + * Page.cs, Control.cs: Fix the order of OnInit invocation of controls + created via master page content (see + http://lists.ximian.com/pipermail/mono-devel-list/2006-May/018585.html ). + 2006-05-11 Andrew Skiba <[EMAIL PROTECTED]> * Page.cs, PageTheme.cs: This patch uses LinkedStyleSheets from the Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2006-05-25 00:03:32 UTC (rev 61097) +++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2006-05-25 07:39:34 UTC (rev 61098) @@ -1253,7 +1253,6 @@ trace.Write ("control", String.Format ("InitRecursive {0} {1}", _userId, type_name)); } #endif - if (HasControls ()) { if ((stateMask & IS_NAMING_CONTAINER) != 0) namingContainer = this; @@ -1275,6 +1274,8 @@ } } + ApplyTheme (); + stateMask |= INITING; #if NET_2_0 if (Adapter != null) @@ -1395,7 +1396,7 @@ #if NET_2_0 internal ControlSkin controlSkin; - internal void ApplyThemeRecursive () + internal void ApplyTheme () { #if MONO_TRACE TraceContext trace = (Context != null && Context.Trace.IsEnabled) ? Context.Trace : null; @@ -1405,17 +1406,10 @@ trace.Write ("control", String.Format ("ApplyThemeRecursive {0} {1}", _userId, type_name)); } #endif - ControlSkin controlSkin = Page.PageTheme.GetControlSkin (GetType(), SkinID); - if (controlSkin != null) - controlSkin.ApplySkin (this); - - if (HasControls ()) { - int len = _controls.Count; - for (int i=0;i<len;i++) - { - Control c = _controls[i]; - c.ApplyThemeRecursive (); - } + if (Page.PageTheme != null) { + ControlSkin controlSkin = Page.PageTheme.GetControlSkin (GetType (), SkinID); + if (controlSkin != null) + controlSkin.ApplySkin (this); } #if MONO_TRACE Modified: trunk/mcs/class/System.Web/System.Web.UI/Page.cs =================================================================== --- trunk/mcs/class/System.Web/System.Web.UI/Page.cs 2006-05-25 00:03:32 UTC (rev 61097) +++ trunk/mcs/class/System.Web/System.Web.UI/Page.cs 2006-05-25 07:39:34 UTC (rev 61098) @@ -491,7 +491,6 @@ } if (_theme != null && _theme != "") { _pageTheme = ThemeDirectoryCompiler.GetCompiledInstance ("./App_Themes/" + _theme + "/", _context); - ApplyThemeRecursive (); } } @@ -1033,6 +1032,7 @@ OnPreInit (EventArgs.Empty); InitializeTheme (); + ApplyMasterPage (); #endif Trace.Write ("aspx.page", "Begin Init"); InitRecursive (null); @@ -1041,7 +1041,6 @@ #if NET_2_0 OnInitComplete (EventArgs.Empty); - ApplyMasterPage (); if (_title != null && htmlHeader != null) htmlHeader.Title = _title; _______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
