Jelajahi Sumber

2006-12-31 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.UI/Page.cs: 
	* System.Web.UI.WebControls/LinkButton.cs: show the validation summary
	when client validation and linkbuttons are used. Patch by Juraj
	Skripsky.


svn path=/trunk/mcs/; revision=70294
Gonzalo Paniagua Javier 19 tahun lalu
induk
melakukan
05bc32c8ea

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

@@ -1,3 +1,8 @@
+2006-12-31 Gonzalo Paniagua Javier <[email protected]>
+
+	* LinkButton.cs: show the validation summary when client validation
+	and linkbuttons are used. Patch by Juraj Skripsky.
+
 2006-12-31 Igor Zelmanovich <[email protected]>
 
 	* TextBox.cs: consider ToolTip property

+ 1 - 1
mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs

@@ -88,7 +88,7 @@ namespace System.Web.UI.WebControls {
 			if (CausesValidation && Page.AreValidatorsUplevel ()) {
 				ClientScriptManager csm = new ClientScriptManager (Page);
 				w.AddAttribute (HtmlTextWriterAttribute.Href,
-						String.Format ("javascript:{{if (typeof(Page_ClientValidate) != 'function' ||  Page_ClientValidate()) {0};}}",
+						String.Format ("javascript:{{if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); {0};}}",
 							       csm.GetPostBackEventReference (this, String.Empty)));
 			} else {
 				w.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink (this, ""));

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

@@ -1,3 +1,8 @@
+2006-12-31 Gonzalo Paniagua Javier <[email protected]>
+
+	* Page.cs: show the validation summary when client validation and
+	linkbuttons are used. Patch by Juraj Skripsky.
+
 2006-12-31 Igor Zelmanovich <[email protected]>
 
 	* Page.cs: fixed: EventValidation is not performed for CallBack request.

+ 1 - 0
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -955,6 +955,7 @@ public class Page : TemplateControl, IHttpHandler
 		writer.WriteLine ("\tvar theForm;\n\tif (document.getElementById) {{ theForm = document.getElementById ('{0}'); }}", formUniqueID);
 		writer.WriteLine ("\telse {{ theForm = document.{0}; }}", formUniqueID);
 		writer.WriteLine ("\tfunction __doPostBack(eventTarget, eventArgument) {");
+		writer.WriteLine ("\t\tif(!ValidatorOnSubmit()) return;");
 		writer.WriteLine ("\t\ttheForm.{0}.value = eventTarget;", postEventSourceID);
 		writer.WriteLine ("\t\ttheForm.{0}.value = eventArgument;", postEventArgumentID);
 		writer.WriteLine ("\t\ttheForm.submit();");