Author: igorz
Date: 2006-09-18 11:02:55 -0400 (Mon, 18 Sep 2006)
New Revision: 65584

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
Log:
make rendering of the onchange attribute to consider ValidationGroup property.
Page.Validate() is called when CausesValidation=true


Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-09-18 15:02:22 UTC (rev 65583)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-09-18 15:02:55 UTC (rev 65584)
@@ -1,5 +1,12 @@
 2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * ListBox.cs: 
+       make rendering of the onchange attribute to consider ValidationGroup 
+       property.
+       Page.Validate() is called when CausesValidation=true
+       
+2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * DropDownList.cs: 
        make rendering of the onclick attribute to consider ValidationGroup 
property
        Page.Validate() is called when CausesValidation=true

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs     
2006-09-18 15:02:22 UTC (rev 65583)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs     
2006-09-18 15:02:55 UTC (rev 65584)
@@ -146,8 +146,12 @@
 #endif
 
                        if (AutoPostBack)
+#if NET_2_0
+                               writer.AddAttribute 
(HtmlTextWriterAttribute.Onchange, Page.ClientScript.GetPostBackEventReference 
(GetPostBackOptions ()));
+#else
                                writer.AddAttribute 
(HtmlTextWriterAttribute.Onchange,
                                                
Page.ClientScript.GetPostBackClientHyperlink (this, ""));
+#endif
 
                        if (SelectionMode == ListSelectionMode.Multiple)
                                writer.AddAttribute 
(HtmlTextWriterAttribute.Multiple,
@@ -157,6 +161,22 @@
                }
 
 #if NET_2_0
+               PostBackOptions GetPostBackOptions () {
+                       PostBackOptions options = new PostBackOptions (this);
+                       options.ActionUrl = null;
+                       options.ValidationGroup = null;
+                       options.Argument = "";
+                       options.RequiresJavaScriptProtocol = false;
+                       options.ClientSubmit = true;
+                       options.PerformValidation = CausesValidation && Page != 
null && Page.AreValidatorsUplevel (ValidationGroup);
+                       if (options.PerformValidation)
+                               options.ValidationGroup = ValidationGroup;
+
+                       return options;
+               }
+#endif         
+
+#if NET_2_0
                protected internal
 #else          
                protected
@@ -248,6 +268,10 @@
 #endif
                void RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       if (CausesValidation)
+                               Page.Validate (ValidationGroup);
+#endif
                        OnSelectedIndexChanged (EventArgs.Empty);
                }
                        

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

Reply via email to