Browse Source

2005-08-29 Chris Toshok <[email protected]>

	* LinkButton.cs: fix some 2.0 Page/ClientScript obsolete warnings.

	* CheckBox.cs: same.
	
	* BaseValidator.cs: same.
	
	* DropDownList.cs: same.
	
	* ValidationSummary.cs: same.


svn path=/trunk/mcs/; revision=49071
Chris Toshok 20 years ago
parent
commit
cf0df4471c

+ 23 - 23
mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs

@@ -387,22 +387,22 @@ namespace System.Web.UI.WebControls {
 			if (RenderUplevel) {
 				RegisterValidatorCommonScript ();
 
-				Page.RegisterOnSubmitStatement ("Mono-System.Web-ValidationOnSubmitStatement",
-								"if (!ValidatorCommonOnSubmit()) return false;");
-				Page.RegisterStartupScript ("Mono-System.Web-ValidationStartupScript",
-							    "<script language=\"JavaScript\">\n" + 
-							    "<!--\n" + 
-							    "var Page_ValidationActive = false;\n" + 
-							    "ValidatorOnLoad();\n" +
-							    "\n" + 
-							    "function ValidatorOnSubmit() {\n" + 
-							    "        if (Page_ValidationActive) {\n" + 
-							    "                return ValidatorCommonOnSubmit();\n" + 
-							    "        }\n" + 
-							    "        return true;\n" + 
-							    "}\n" + 
-							    "// -->\n" + 
-							    "</script>\n");
+				Page.ClientScript.RegisterOnSubmitStatement ("Mono-System.Web-ValidationOnSubmitStatement",
+									     "if (!ValidatorCommonOnSubmit()) return false;");
+				Page.ClientScript.RegisterStartupScript ("Mono-System.Web-ValidationStartupScript",
+									 "<script language=\"JavaScript\">\n" + 
+									 "<!--\n" + 
+									 "var Page_ValidationActive = false;\n" + 
+									 "ValidatorOnLoad();\n" +
+									 "\n" + 
+									 "function ValidatorOnSubmit() {\n" + 
+									 "        if (Page_ValidationActive) {\n" + 
+									 "                return ValidatorCommonOnSubmit();\n" + 
+									 "        }\n" + 
+									 "        return true;\n" + 
+									 "}\n" + 
+									 "// -->\n" + 
+									 "</script>\n");
 			}
 		}
 
@@ -428,18 +428,18 @@ namespace System.Web.UI.WebControls {
 
 		protected void RegisterValidatorCommonScript ()
 		{
-			if (!Page.IsClientScriptBlockRegistered ("Mono-System.Web-ValidationClientScriptBlock")) {
-				Page.RegisterClientScriptBlock ("Mono-System.Web-ValidationClientScriptBlock",
-								String.Format ("<script language=\"JavaScript\" src=\"{0}\"></script>",
-									       Page.ClientScript.GetWebResourceUrl (GetType(),
-														    "WebUIValidation.js")));
+			if (!Page.ClientScript.IsClientScriptBlockRegistered ("Mono-System.Web-ValidationClientScriptBlock")) {
+				Page.ClientScript.RegisterClientScriptBlock ("Mono-System.Web-ValidationClientScriptBlock",
+									     String.Format ("<script language=\"JavaScript\" src=\"{0}\"></script>",
+											    Page.ClientScript.GetWebResourceUrl (GetType(),
+																 "WebUIValidation.js")));
 			}
 		}
 
 		protected virtual void RegisterValidatorDeclaration ()
 		{
-			Page.RegisterArrayDeclaration ("Page_Validators",
-						       String.Format ("document.getElementById ('{0}')", ID));
+			Page.ClientScript.RegisterArrayDeclaration ("Page_Validators",
+								    String.Format ("document.getElementById ('{0}')", ID));
 		}
 
 #if NET_2_0

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

@@ -1,3 +1,15 @@
+2005-08-29  Chris Toshok  <[email protected]>
+
+	* LinkButton.cs: fix some 2.0 Page/ClientScript obsolete warnings.
+
+	* CheckBox.cs: same.
+	
+	* BaseValidator.cs: same.
+	
+	* DropDownList.cs: same.
+	
+	* ValidationSummary.cs: same.
+
 2005-08-28  Chris Toshok  <[email protected]>
 
 	* XmlHierarchyData.cs: fix IHierarchyData.GetParent.

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

@@ -256,7 +256,7 @@ namespace System.Web.UI.WebControls {
 					NameAttribute);
 			
 			if (AutoPostBack) {
-				w.AddAttribute (HtmlTextWriterAttribute.Onclick, Page.GetPostBackClientHyperlink (this, ""));
+				w.AddAttribute (HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackClientHyperlink (this, ""));
 			}
 
 			if (Checked) {

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

@@ -100,7 +100,7 @@ namespace System.Web.UI.WebControls
 					PostBackOptions ops = pcner.GetPostBackOptions (this);
 					postScript = container.Page.ClientScript.GetPostBackEventReference (ops);
 				} else
-					postScript = Page.ClientScript.GetPostBackClientEvent (this, "");
+					postScript = Page.ClientScript.GetPostBackEventReference (this, "");
 
 				if (CausesValidation && Page.Validators.Count > 0) {
 					// TOSHOK: review if this is the correct usage of the "fresh" client side stuff

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

@@ -117,7 +117,7 @@ namespace System.Web.UI.WebControls {
 			writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
 
 			if (AutoPostBack) {
-				writer.AddAttribute (HtmlTextWriterAttribute.Onchange, Page.GetPostBackClientHyperlink (this, ""));
+				writer.AddAttribute (HtmlTextWriterAttribute.Onchange, Page.ClientScript.GetPostBackClientHyperlink (this, ""));
 			}
 
 			base.AddAttributesToRender(writer);

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

@@ -67,7 +67,7 @@ namespace System.Web.UI.WebControls {
 							       csm.GetPostBackEventReference (this, String.Empty)));
 				w.AddAttribute ("language", "javascript");
 			} else {
-				w.AddAttribute (HtmlTextWriterAttribute.Href, Page.GetPostBackClientHyperlink (this, ""));
+				w.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink (this, ""));
 			}
 		}
 

+ 2 - 2
mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs

@@ -205,8 +205,8 @@ namespace System.Web.UI.WebControls {
 			}
 
 			if (EnableClientScript && pre_render_called) {
-				Page.RegisterArrayDeclaration ("Page_ValidationSummaries",
-							       String.Format ("document.getElementById ('{0}')", ID));
+				Page.ClientScript.RegisterArrayDeclaration ("Page_ValidationSummaries",
+									    String.Format ("document.getElementById ('{0}')", ID));
 			}
 
 			// We have validators