Ver código fonte

2005-04-22 Lluis Sanchez Gual <[email protected]>

	* HtmlForm.cs: Use the new WriteSubmitStatements method from
	Page.ClientScript.


svn path=/trunk/mcs/; revision=43436
Lluis Sanchez 21 anos atrás
pai
commit
e7a6837585

+ 5 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog

@@ -1,3 +1,8 @@
+2005-04-22  Lluis Sanchez Gual <[email protected]>
+
+	* HtmlForm.cs: Use the new WriteSubmitStatements method from
+	Page.ClientScript.
+
 2005-03-11  Lluis Sanchez Gual <[email protected]>
 
 	* HtmlInputButton.cs, HtmlAnchor.cs, HtmlButton.cs: Don't use

+ 6 - 14
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs

@@ -6,7 +6,6 @@
 using System;
 using System.Collections;
 using System.ComponentModel;
-using System.Text;
 using System.Web;
 using System.Web.UI;
 using System.Web.Util;
@@ -31,24 +30,17 @@ namespace System.Web.UI.HtmlControls{
 				writer.WriteAttribute ("enctype", Enctype);
 				Attributes.Remove ("enctype");
 			}
-
-			Hashtable onSubmit = Page.ClientScript.submitStatements;
- 			if (onSubmit != null && onSubmit.Count > 0){
-				StringBuilder sb = new StringBuilder ();
+
+			string submitStatements = Page.ClientScript.WriteSubmitStatements ();
+ 			if (submitStatements != null) {
 				string prev = Attributes ["onsubmit"];
- 				if (prev != null){
-					sb.Append (prev);
+ 				if (prev != null) {
+ 					submitStatements = prev + submitStatements;
  					Attributes.Remove ("onsubmit");
  				}
 
-				foreach (Hashtable hash in onSubmit.Values) {
-					foreach (string s in hash.Values) {
-						sb.Append (s);
-					}
-				}
-
  				writer.WriteAttribute ("language", "javascript");
- 				writer.WriteAttribute ("onsubmit", sb.ToString ());
+ 				writer.WriteAttribute ("onsubmit", submitStatements);
  			}
 
 			if (ID == null)