Author: mhabersack
Date: 2007-04-05 07:25:05 -0400 (Thu, 05 Apr 2007)
New Revision: 75425

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataBoundControl.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
Log:
2007-04-05  Marek Habersack  <[EMAIL PROTECTED]>

        * BaseDataBoundControl.cs: restore the LAMESPEC note and code it
        describes - tests show this is what's happening on MS.NET as
        well.


Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataBoundControl.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataBoundControl.cs    
    2007-04-05 11:23:18 UTC (rev 75424)
+++ 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/BaseDataBoundControl.cs    
    2007-04-05 11:25:05 UTC (rev 75425)
@@ -107,10 +107,21 @@
                                // to bind to, the DataBind method is called
                                // immediately. In this case, the
                                // RequiresDataBinding property is _not_ 
actually
-                               // set to true. 
-                               if (value && preRendered && 
IsBoundUsingDataSourceID && Page != null && !Page.IsCallback)
-                                       DataBind ();
-                               else
+                               // set to true.
+                               //
+                               // LAMESPEC, the docs quoted above mention that
+                               // DataBind is called in the described
+                               // case. This is wrong since that way we don't
+                               // break recursion when the property is set from
+                               // within the OnSelect handler in user's
+                               // code. EnsureDataBound makes sure that no
+                               // recursive binding is performed. Also the
+                               // property DOES get set in this case (according
+                               // to tests)
+                               if (value && preRendered && 
IsBoundUsingDataSourceID && Page != null && !Page.IsCallback) {
+                                       requiresDataBinding = true;
+                                       EnsureDataBound ();
+                               | else
                                        requiresDataBinding = value;
                        }
                }

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-04-05 11:23:18 UTC (rev 75424)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-04-05 11:25:05 UTC (rev 75425)
@@ -1,3 +1,9 @@
+2007-04-05  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * BaseDataBoundControl.cs: restore the LAMESPEC note and code it
+       describes - tests show this is what's happening on MS.NET as
+       well.
+
 2007-04-05 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * GridView.cs:

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

Reply via email to