Author: igorz
Date: 2006-11-14 08:57:06 -0500 (Tue, 14 Nov 2006)
New Revision: 67843

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompositeDataBoundControl.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeDataBoundControlTest.cs
Log:
2006-11-14 Igor Zelmanovich <[EMAIL PROTECTED]>

        * CompositeDataBoundControl.cs: fixed: 
        DataBind call Controls.Clear().



Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-14 13:44:15 UTC (rev 67842)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-11-14 13:57:06 UTC (rev 67843)
@@ -1,3 +1,8 @@
+2006-11-14 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * CompositeDataBoundControl.cs: fixed: 
+       DataBind call Controls.Clear().
+
 2006-11-13 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * CompositeDataBoundControl.cs: fixed: 

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompositeDataBoundControl.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompositeDataBoundControl.cs
   2006-11-14 13:44:15 UTC (rev 67842)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CompositeDataBoundControl.cs
   2006-11-14 13:57:06 UTC (rev 67843)
@@ -64,7 +64,7 @@
                
                protected internal override void PerformDataBinding 
(IEnumerable data)
                {
-                       ChildControlsCreated = true;
+                       Controls.Clear ();
                        ViewState ["_ItemCount"] = CreateChildControls (data, 
true);
                }
                

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-14 13:44:15 UTC (rev 67842)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-14 13:57:06 UTC (rev 67843)
@@ -1,3 +1,7 @@
+2006-11-14  Igor Zelmanovich   <[EMAIL PROTECTED]>
+
+       * CompositeDataBoundControlTest.cs: added tests.
+
 2006-11-13  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * LoginTest.cs: login tests converted to webtest

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeDataBoundControlTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeDataBoundControlTest.cs
  2006-11-14 13:44:15 UTC (rev 67842)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/CompositeDataBoundControlTest.cs
  2006-11-14 13:57:06 UTC (rev 67843)
@@ -51,10 +51,12 @@
                        public bool createChildControls2 = false;
                        public bool dataBind = false;
                        public bool CreateChildControls_ChildControlsCreated;
+                       public int CreateChildControls_Controls_Count;
 
                        protected override int CreateChildControls (IEnumerable 
dataSource, bool dataBinding) {
                                createChildControls2 = true;
                                CreateChildControls_ChildControlsCreated = 
ChildControlsCreated;
+                               CreateChildControls_Controls_Count = 
Controls.Count;
                                return 10;
                        }
 
@@ -133,6 +135,17 @@
                        c.DoCreateChildControls ();
                        Assert.AreEqual (0, c.Controls.Count);
                }
+
+               [Test]
+               public void DetailsView_CreateChildControls_Clear2 () {
+                       MyCompositeDataBoundControl c = new 
MyCompositeDataBoundControl ();
+                       c.Controls.Add (new WebControl (HtmlTextWriterTag.A));
+                       Assert.AreEqual (1, c.Controls.Count, "Controls.Count 
before DataBind");
+                       c.DataBind ();
+                       Assert.AreEqual (0, 
c.CreateChildControls_Controls_Count, "Controls.Count in CreateChildControls");
+                       Assert.AreEqual (0, c.Controls.Count, "Controls.Count 
after DataBind");
+
+               }
                
                [Test]
                public void DataBind_ChildControlsCreated () {
@@ -141,6 +154,9 @@
                        p.Controls.Add (c);
                        Assert.IsFalse (c.GetChildControlsCreated (), 
"ChildControlsCreated before DataBind");
                        c.DataBind ();
+                       Assert.IsTrue (c.ensureCreateChildControls);
+                       Assert.IsTrue (c.createChildControls1);
+                       Assert.IsTrue (c.createChildControls2);
                        Assert.IsTrue 
(c.CreateChildControls_ChildControlsCreated, "ChildControlsCreated in 
CreateChildControls");
                        Assert.IsTrue (c.GetChildControlsCreated (), 
"ChildControlsCreated after DataBind");
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to