diff options
author | Alon Gazit <alon@mono-cvs.ximian.com> | 2003-12-14 19:44:08 +0300 |
---|---|---|
committer | Alon Gazit <alon@mono-cvs.ximian.com> | 2003-12-14 19:44:08 +0300 |
commit | da27ee2dbb2943883bb325a354ba7b75b6ed4458 (patch) | |
tree | ca225324c06e4f03a4cc65fdf0812c60a6591556 /mcs/class | |
parent | c3f5f68b173a1124aa92b12c37a636a24e22a5bf (diff) |
The problem was in HtmlInputButton.RenderAttributes().
Before adding the script to the HTML, the number of Validators should
be checked.
svn path=/trunk/mcs/; revision=21119
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog | 5 | ||||
-rwxr-xr-x | mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs | 23 |
2 files changed, 18 insertions, 10 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog index a0ea5f913e8..87e16f83662 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog @@ -1,3 +1,8 @@ +2003-12-14 Alon Gazit <along@mainsoft.com> + * HtmlInputButton.cs: The problem was in RenderAttributes().
+ Before adding the script to the HTML, the number of Validators should
+ be checked. fixes bug #52158. + 2003-12-07 Alon Gazit <along@mainsoft.com> * HtmlTableCell.cs: fixing a typo in NoWrap property. diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs index ecd437a237e..7be2fd546b8 100755 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs @@ -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);
}
}
|