Author: igorz
Date: 2006-09-19 06:27:51 -0400 (Tue, 19 Sep 2006)
New Revision: 65625
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
Log:
* CheckBox.cs:
make onclick attribute to consider ValidationGroup property.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-19 08:19:38 UTC (rev 65624)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-19 10:27:51 UTC (rev 65625)
@@ -1,3 +1,8 @@
+2006-09-19 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * CheckBox.cs:
+ make onclick attribute to consider ValidationGroup property.
+
2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
* BulletedLis.cs:
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
2006-09-19 08:19:38 UTC (rev 65624)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
2006-09-19 10:27:51 UTC (rev 65625)
@@ -399,8 +399,12 @@
w.AddAttribute
(HtmlTextWriterAttribute.Checked, "checked");
if (AutoPostBack){
+#if NET_2_0
+ w.AddAttribute
(HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference
(GetPostBackOptions ()));
+#else
w.AddAttribute
(HtmlTextWriterAttribute.Onclick,
Page.ClientScript.GetPostBackEventReference (this, String.Empty));
+#endif
w.AddAttribute ("language",
"javascript");
}
@@ -447,8 +451,12 @@
w.AddAttribute
(HtmlTextWriterAttribute.Checked, "checked");
if (AutoPostBack){
+#if NET_2_0
+ w.AddAttribute
(HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference
(GetPostBackOptions ()));
+#else
w.AddAttribute
(HtmlTextWriterAttribute.Onclick,
Page.ClientScript.GetPostBackEventReference (this, String.Empty));
+#endif
w.AddAttribute ("language",
"javascript");
}
@@ -512,6 +520,20 @@
}
#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;
+ }
+
protected override void AddAttributesToRender (HtmlTextWriter
writer)
{
base.AddAttributesToRender (writer);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches