Merge pull request #2781 from alexanderkyte/inflated_method_header_leak
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / CheckBox.cs
index 905740a1ea9d9f4d4e896cadb7e7ceaa1e177f25..27c3a7fb9dc870f7018c9a6956ef0871173ecb54 100644 (file)
@@ -370,7 +370,11 @@ namespace System.Web.UI.WebControls
                                Page page = Page;
                                string onclick = page != null ? page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true) : String.Empty;
                                onclick = String.Concat ("setTimeout('", onclick.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)");
-                               w.AddAttribute (HtmlTextWriterAttribute.Onclick, BuildScriptAttribute ("onclick", onclick));
+                               if (common_attrs != null && common_attrs ["onclick"] != null) {
+                                       onclick = ClientScriptManager.EnsureEndsWithSemicolon (common_attrs ["onclick"]) + onclick;
+                                       common_attrs.Remove ("onclick");
+                               }
+                               w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
                        }
 
                        if (AccessKey.Length > 0)