浏览代码

2005-06-04 Gonzalo Paniagua Javier <[email protected]>

	* System.Web.UI/Page.cs: added AddContentTemplate method.
	* System.Web.Compilation/TemplateControlCompiler.cs: use the Page
	AddContentTemplate method, as the one in Master is protected. Fixes
	bug #75157.


svn path=/trunk/mcs/; revision=45418
Gonzalo Paniagua Javier 20 年之前
父节点
当前提交
08ea665cd2

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

@@ -1,3 +1,8 @@
+2005-06-04 Gonzalo Paniagua Javier <[email protected]>
+
+	* TemplateControlCompiler.cs: use the Page AddContentTemplate method,
+	as the one in Master is protected. Fixes bug #75157.
+
 2005-05-06 Gonzalo Paniagua Javier <[email protected]>
 
 	* AspComponentFoundry.cs: tagnames have precedence over types in

+ 1 - 4
mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs

@@ -625,16 +625,13 @@ namespace System.Web.Compilation
 
 		void AddContentTemplateInvocation (ContentControlBuilder cbuilder, CodeMemberMethod method, string methodName)
 		{
-			CodePropertyReferenceExpression pag = new CodePropertyReferenceExpression (ctrlVar, "Page");
-			CodePropertyReferenceExpression prop = new CodePropertyReferenceExpression (pag, "Master");
-
 			CodeObjectCreateExpression newBuild = new CodeObjectCreateExpression (typeof (BuildTemplateMethod));
 			newBuild.Parameters.Add (new CodeMethodReferenceExpression (thisRef, methodName));
 
 			CodeObjectCreateExpression newCompiled = new CodeObjectCreateExpression (typeof (CompiledTemplateBuilder));
 			newCompiled.Parameters.Add (newBuild);
 			
-			CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression (prop, "AddContentTemplate");
+			CodeMethodInvokeExpression invoke = new CodeMethodInvokeExpression (thisRef, "AddContentTemplate");
 			invoke.Parameters.Add (new CodePrimitiveExpression (cbuilder.ContentPlaceHolderID));
 			invoke.Parameters.Add (newCompiled);
 

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

@@ -1,3 +1,7 @@
+2005-06-04 Gonzalo Paniagua Javier <[email protected]>
+
+	* Page.cs: added AddContentTemplate method.
+
 2005-05-26 Gonzalo Paniagua Javier <[email protected]>
 
 	* AttributeCollection.cs: html-encode attribute values. Fixes

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

@@ -1428,6 +1428,11 @@ public class Page : TemplateControl, IHttpHandler
 	}
 
 
+	protected internal void AddContentTemplate (string templateName, ITemplate template)
+	{
+		Master.AddContentTemplate (templateName, template);
+	}
+		
 	#endif
 }
 }