Browse Source

2007-10-29 Marek Habersack <[email protected]>

	* TemplateParser.cs: add the file pointed to by the Src or
	CodeFile attributes to the list of page cache dependencies.

	* PageParser.cs, UserControlParser.cs: Add the MasterPage file to
	the list of page cache dependencies.

	* MasterPageParser.cs: add the source pointed to by VirtualPath to
	the list of cache dependencies.

svn path=/trunk/mcs/; revision=88403
Marek Habersack 18 years ago
parent
commit
cc4155bff0

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

@@ -1,3 +1,14 @@
+2007-10-29  Marek Habersack  <[email protected]>
+
+	* TemplateParser.cs: add the file pointed to by the Src or
+	CodeFile attributes to the list of page cache dependencies.
+
+	* PageParser.cs, UserControlParser.cs: Add the MasterPage file to
+	the list of page cache dependencies.
+
+	* MasterPageParser.cs: add the source pointed to by VirtualPath to
+	the list of cache dependencies.
+
 2007-10-23  Marek Habersack  <[email protected]>
 
 	* ClientScriptManager.cs: added two constants to define start/end

+ 6 - 3
mcs/class/System.Web/System.Web.UI/MasterPageParser.cs

@@ -86,9 +86,12 @@ namespace System.Web.UI
 						ThrowParseException ("Could not load type '" + type + "'.");
 				} else {
 					string path = GetString (atts, "VirtualPath", null);
-					if (path != null)
-						masterType = MasterPageParser.GetCompiledMasterType (path, MapPath (path), HttpContext.Current);
-					else
+					if (path != null) {
+						string mappedPath = MapPath (path);
+						masterType = MasterPageParser.GetCompiledMasterType (path, mappedPath,
+												     HttpContext.Current);
+						AddDependency (mappedPath);
+					} else
 						ThrowParseException ("The MasterType directive must have either a TypeName or a VirtualPath attribute.");				}
 				AddAssembly (masterType.Assembly, true);
 			}

+ 6 - 3
mcs/class/System.Web/System.Web.UI/PageParser.cs

@@ -349,9 +349,12 @@ namespace System.Web.UI
 			masterPage = GetString (atts, "MasterPageFile", masterPage);
 			
 			// Make sure the page exists
-			if (!String.IsNullOrEmpty (masterPage))
-				MasterPageParser.GetCompiledMasterType (masterPage, MapPath (masterPage), HttpContext.Current);
-
+			if (!String.IsNullOrEmpty (masterPage)) {
+				string path = MapPath (masterPage);
+				MasterPageParser.GetCompiledMasterType (masterPage, path, HttpContext.Current);
+				AddDependency (path);
+			}
+			
 			title = GetString(atts, "Title", null);
 
 			theme = GetString (atts, "Theme", theme);

+ 3 - 0
mcs/class/System.Web/System.Web.UI/TemplateParser.cs

@@ -578,6 +578,9 @@ namespace System.Web.UI {
 			if (inherits != null)
 				SetBaseType (inherits);
 #endif
+			if (src != null)
+				AddDependency (MapPath (src, false));
+			
 			className = GetString (atts, "ClassName", null);
 			if (className != null) {
 #if NET_2_0

+ 3 - 1
mcs/class/System.Web/System.Web.UI/UserControlParser.cs

@@ -99,7 +99,9 @@ namespace System.Web.UI
 			if (masterPage != null) {
 				// Make sure the page exists
 				if (masterPage != null) {
-					MasterPageParser.GetCompiledMasterType (masterPage, MapPath (masterPage), HttpContext.Current);
+					string path = MapPath (masterPage);
+					MasterPageParser.GetCompiledMasterType (masterPage, path, HttpContext.Current);
+					AddDependency (path);
 				}
 			}
 #endif