Author: igorz
Date: 2006-09-17 09:22:12 -0400 (Sun, 17 Sep 2006)
New Revision: 65538
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
Log:
make rendering of the onclick attribute to consider ValidationGroup property
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-09-17 12:48:25 UTC
(rev 65537)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2006-09-17 13:22:12 UTC
(rev 65538)
@@ -1,3 +1,7 @@
+2006-19-17 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * ClientScriptManager.cs: added helper method
+
2006-09-14 Igor Zelmanovich <[EMAIL PROTECTED]>
* Page.cs: fixed: GetValidators(string), Validate(string) works properly
Modified: trunk/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
2006-09-17 12:48:25 UTC (rev 65537)
+++ trunk/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
2006-09-17 13:22:12 UTC (rev 65538)
@@ -389,6 +389,12 @@
}
}
+#if NET_2_0
+ internal string GetClientValidationEvent (string
validationGroup) {
+ return "if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate('" + validationGroup + "');";
+ }
+#endif
+
internal string GetClientValidationEvent ()
{
return "if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate();";
Modified: trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
2006-09-17 12:48:25 UTC (rev 65537)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
2006-09-17 13:22:12 UTC (rev 65538)
@@ -1,5 +1,10 @@
2006-09-17 Igor Zelmanovich <[EMAIL PROTECTED]>
+ * HtmlInputImage.cs:
+ make rendering of the onclick attribute to consider ValidationGroup
property
+
+2006-09-17 Igor Zelmanovich <[EMAIL PROTECTED]>
+
* HtmlInputButton.cs:
make rendering of the onclick attribute to consider ValidationGroup
property
Modified:
trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
2006-09-17 12:48:25 UTC (rev 65537)
+++ trunk/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
2006-09-17 13:22:12 UTC (rev 65538)
@@ -245,10 +245,17 @@
protected override void RenderAttributes (HtmlTextWriter writer)
{
+#if NET_2_0
+ if (CausesValidation && Page != null &&
Page.AreValidatorsUplevel (ValidationGroup)) {
+ ClientScriptManager csm = Page.ClientScript;
+ Attributes ["onclick"] +=
csm.GetClientValidationEvent (ValidationGroup);
+ }
+#else
if (CausesValidation && Page != null &&
Page.AreValidatorsUplevel ()) {
ClientScriptManager csm = new
ClientScriptManager (Page);
writer.WriteAttribute ("onclick",
csm.GetClientValidationEvent ());
}
+#endif
base.RenderAttributes (writer);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches