Author: igorz
Date: 2006-09-18 10:37:33 -0400 (Mon, 18 Sep 2006)
New Revision: 65581
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
Log:
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/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-18 14:35:10 UTC (rev 65580)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-09-18 14:37:33 UTC (rev 65581)
@@ -1,5 +1,11 @@
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
+
+2006-09-18 Igor Zelmanovich <[EMAIL PROTECTED]>
+
* ListControl.cs:
VewState saving and restoring rolled back to 1.1 implementation
(fixed corresponding test), corrected public interface (there are no
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
2006-09-18 14:35:10 UTC (rev 65580)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs
2006-09-18 14:37:33 UTC (rev 65581)
@@ -131,12 +131,32 @@
writer.AddAttribute(HtmlTextWriterAttribute.Name,
this.UniqueID, true);
#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
}
base.AddAttributesToRender(writer);
}
+#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
+
protected override ControlCollection CreateControlCollection() {
return base.CreateControlCollection();
}
@@ -213,6 +233,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