Преглед изворни кода

2008-01-01 Igor Zelmanovich <[email protected]>

	* Page.cs:
	make SubmitDisabledControls and SetFocus works in multiform environment		


svn path=/trunk/mcs/; revision=92091
Igor Zelmanovich пре 18 година
родитељ
комит
25aa796fcf

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

@@ -1,3 +1,8 @@
+2008-01-01 Igor Zelmanovich <[email protected]>
+
+	* Page.cs:
+	make SubmitDisabledControls and SetFocus works in multiform environment		
+
 2007-12-31  Vladimir Krasnov  <[email protected]>
 
 	* Page.cs: fixed thread abort handling in ProcessRequest

+ 20 - 5
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -2040,17 +2040,32 @@ public partial class Page : TemplateControl, IHttpHandler
 
 		if (!String.IsNullOrEmpty (_focusedControlID)) {
 			ClientScript.RegisterWebFormClientScript ();
+			
+			string webForm;
+			if (IsMultiForm)
+				webForm = theForm + ".";
+			else
+				webForm = String.Empty;
+			
 			ClientScript.RegisterStartupScript (
+				typeof(Page),
 				"HtmlForm-DefaultButton-StartupScript",
-				"<script type=\"text/javascript\">\n" + ClientScriptManager.SCRIPT_BLOCK_START +
-				"\nWebForm_AutoFocus('" + _focusedControlID + "');\n" + ClientScriptManager.SCRIPT_BLOCK_END +
-				"\n</script>\n");
+				"\n" + webForm + "WebForm_AutoFocus('" + _focusedControlID + "');\n", true);
 		}
 		
 		if (Form.SubmitDisabledControls && _hasEnabledControlArray) {
 			ClientScript.RegisterWebFormClientScript ();
-			ClientScript.RegisterOnSubmitStatement ("HtmlForm-SubmitDisabledControls-SubmitStatement",
-								"WebForm_ReEnableControls(this);");
+
+			string webForm;
+			if (IsMultiForm)
+				webForm = theForm + ".";
+			else
+				webForm = String.Empty;
+
+			ClientScript.RegisterOnSubmitStatement (
+				typeof (Page),
+				"HtmlForm-SubmitDisabledControls-SubmitStatement",
+				webForm + "WebForm_ReEnableControls();");
 		}
 	}