New test.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlInputImage.cs
index 0c7342c34c68c912a2679de3be2ff70bdaaf89b0..9e441310ab7ca4c704d2ea32d1625cbde2c99a56 100644 (file)
@@ -245,10 +245,20 @@ namespace System.Web.UI.HtmlControls {
 
                protected override void RenderAttributes (HtmlTextWriter writer)
                {
+#if NET_2_0
+                       if (Page != null)
+                               Page.ClientScript.RegisterForEventValidation (this.UniqueID);
+                       
+                       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);
                }