|
|
@@ -33,20 +33,23 @@ namespace System.Web.UI.HtmlControls{
|
|
|
{
|
|
|
if (Page != null && CausesValidation) {
|
|
|
string type = Type;
|
|
|
+ Console.WriteLine(type);
|
|
|
if (String.Compare (type, "button", true) == 0 || String.Compare (type, "submit", true) == 0) {
|
|
|
string script = Page.GetPostBackClientEvent (this, String.Empty);
|
|
|
- AttributeCollection coll = Attributes;
|
|
|
- if (coll ["language"] != null)
|
|
|
- coll.Remove ("language");
|
|
|
- writer.WriteAttribute ("language", "javascript");
|
|
|
+ if (script != null && Page.Validators.Count > 0){
|
|
|
+ AttributeCollection coll = Attributes;
|
|
|
+ if (coll ["language"] != null)
|
|
|
+ coll.Remove ("language");
|
|
|
+ writer.WriteAttribute ("language", "javascript");
|
|
|
|
|
|
- string onclick;
|
|
|
- if ((onclick = coll ["onclick"]) != null) {
|
|
|
- script = onclick + " " + script;
|
|
|
- coll.Remove ("onclick");
|
|
|
+ string onclick;
|
|
|
+ if ((onclick = coll ["onclick"]) != null) {
|
|
|
+ script = onclick + " " + script;
|
|
|
+ coll.Remove ("onclick");
|
|
|
+ }
|
|
|
+
|
|
|
+ writer.WriteAttribute ("onclick", script);
|
|
|
}
|
|
|
-
|
|
|
- writer.WriteAttribute ("onclick", script);
|
|
|
}
|
|
|
}
|
|
|
|