Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Gazit <alon@mono-cvs.ximian.com>2003-12-14 19:44:08 +0300
committerAlon Gazit <alon@mono-cvs.ximian.com>2003-12-14 19:44:08 +0300
commitda27ee2dbb2943883bb325a354ba7b75b6ed4458 (patch)
treeca225324c06e4f03a4cc65fdf0812c60a6591556 /mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
parentc3f5f68b173a1124aa92b12c37a636a24e22a5bf (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/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs')
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs23
1 files changed, 13 insertions, 10 deletions
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);
}
}