2007-01-04 Igor Zelmanovich <igorz@mainsoft.com>
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Thu, 4 Jan 2007 10:27:20 +0000 (10:27 -0000)
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Thu, 4 Jan 2007 10:27:20 +0000 (10:27 -0000)
* Page.cs: fixed: InitializeCulture should be called
before creating controls.

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

mcs/class/System.Web/System.Web.Compilation/PageCompiler.cs
mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/Page.cs
mcs/class/System.Web/Test/System.Web.UI/PageTest.cs
mcs/class/System.Web/Test/mainsoft/NunitWebResources/PageCultureTest.aspx

index a312ea843430b364147bac3ba22d862c5e59dd66..b1535049329b00f9b131bd83a571ed83a1bdefc2 100644 (file)
@@ -141,6 +141,9 @@ namespace System.Web.Compilation
                protected override void AddStatementsToInitMethod (CodeMemberMethod method)
                {
 #if NET_2_0
+                       CodeMethodInvokeExpression expr = new CodeMethodInvokeExpression (thisRef, "InitializeCulture");
+                       method.Statements.Add (new CodeExpressionStatement (expr));
+
                        CodeArgumentReferenceExpression ctrlVar = new CodeArgumentReferenceExpression("__ctrl");
                        if (pageParser.Title != null)
                                method.Statements.Add (CreatePropertyAssign (ctrlVar, "Title", pageParser.Title));
@@ -289,3 +292,4 @@ namespace System.Web.Compilation
        }
 }
 
+
index c33a99efe18d09cfa0e0ccdf759fa24a4ee828cd..995879a7fc934fa703d4afde60c47632d46dd0e4 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-04 Igor Zelmanovich <igorz@mainsoft.com>
+
+       * Page.cs: fixed: InitializeCulture should be called 
+       before creating controls.
+
 2007-01-03  Marek Habersack  <grendello@gmail.com>
 
        * Page.cs: Make sure the ValidatorOnSubmit function is defined for the
index d6f4256889f6bb85a878791fdd42a10500136e5c..08bf7241b6a4c876b74ff3d2eafddee45b8505a9 100644 (file)
@@ -1166,7 +1166,6 @@ public class Page : TemplateControl, IHttpHandler
                previousPage = _context.LastPage;
                _context.LastPage = this;
 
-               InitializeCulture ();
                _lifeCycle = PageLifeCycle.PreInit;
                OnPreInit (EventArgs.Empty);
 
index a032490cd77dff25af7ef3bd7abc65d6297f69aa..e5b7482137776a189791f3b25a47420cab282e63 100644 (file)
@@ -115,7 +115,7 @@ namespace MonoTests.System.Web.UI {
                [TestFixtureSetUp]
                public void SetUpTest ()
                {
-#if DOT_NET
+#if VISUAL_STUDIO
                        WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.PageCultureTest.aspx", "PageCultureTest.aspx");
                        WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.PageLifecycleTest.aspx", "PageLifecycleTest.aspx");
                        WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.PageValidationTest.aspx", "PageValidationTest.aspx");
@@ -856,7 +856,7 @@ namespace MonoTests.System.Web.UI {
                        if (eventlist == null)
                                Assert.Fail ("User data does not been created fail");
 
-                       Assert.AreEqual ("InitializeCulture", eventlist[0], "Live Cycle Flow #0");
+                       Assert.AreEqual ("InitializeCulture:0", eventlist[0], "Live Cycle Flow #0");
                        Assert.AreEqual ("OnPreInit", eventlist[1], "Live Cycle Flow #1");
                        Assert.AreEqual ("OnInit", eventlist[2], "Live Cycle Flow #2");
                        Assert.AreEqual ("OnInitComplete", eventlist[3], "Live Cycle Flow #3");
index 12247e3012b54b0e92b569d99e291599fb8c4add..dcaec803707de23de0a2b4787dc563345d95b3d5 100644 (file)
         {\r
             if (WebTest.CurrentTest.UserData == null) {\r
                 ArrayList list = new ArrayList ();\r
-                list.Add ("InitializeCulture");\r
+                               list.Add ("InitializeCulture:" + this.Controls.Count);\r
                 WebTest.CurrentTest.UserData = list;\r
             }\r
             else {\r
                 ArrayList list = WebTest.CurrentTest.UserData as ArrayList;\r
                 if (list == null)\r
                     throw new NullReferenceException ();\r
-                list.Add ("InitializeCulture");\r
+                               list.Add ("InitializeCulture:" + this.Controls.Count);\r
                 WebTest.CurrentTest.UserData = list;\r
             }\r
             base.InitializeCulture ();\r