diff options
7 files changed, 27 insertions, 14 deletions
diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog index a47d68099d4..b4de25b707b 100644 --- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog +++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog @@ -1,5 +1,10 @@ 2003-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * TemplateControlCompiler.cs: correctly set the TemplateSourceDirectory + value. + +2003-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * AspGenerator.cs: handle code render syntax in tag attributes. * AspParser.cs: the constructor now takes a TextReader. diff --git a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs index d4c2e9e2ac5..8d6f7e343f2 100644 --- a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs +++ b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs @@ -759,7 +759,7 @@ namespace System.Web.Compilation prop.Name = "TemplateSourceDirectory"; prop.Attributes = MemberAttributes.Public | MemberAttributes.Override; - CodePrimitiveExpression expr = new CodePrimitiveExpression (parser.CurrentVirtualPath); + CodePrimitiveExpression expr = new CodePrimitiveExpression (parser.BaseVirtualDir); prop.GetStatements.Add (new CodeMethodReturnStatement (expr)); mainClass.Members.Add (prop); } diff --git a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs index 0430d7e0cc7..780f33f0db1 100644 --- a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs +++ b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs @@ -14,9 +14,10 @@ namespace System.Web.UI { sealed class ApplicationFileParser : TemplateParser { - public ApplicationFileParser (string fname) + public ApplicationFileParser (string fname, HttpContext context) { InputFile = fname; + Context = context; } protected override Type CompileIntoType () @@ -27,7 +28,7 @@ namespace System.Web.UI internal static Type GetCompiledApplicationType (string inputFile, HttpContext context) { - ApplicationFileParser parser = new ApplicationFileParser (inputFile); + ApplicationFileParser parser = new ApplicationFileParser (inputFile, context); parser.Context = context; return parser.CompileIntoType (); } @@ -39,6 +40,10 @@ namespace System.Web.UI protected internal override string DefaultDirectiveName { get { return "application"; } } + + internal override string BaseVirtualDir { + get { return Context.Request.ApplicationPath; } + } } } diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs index e314e9d2326..91aae69bbf8 100755 --- a/mcs/class/System.Web/System.Web.UI/BaseParser.cs +++ b/mcs/class/System.Web/System.Web.UI/BaseParser.cs @@ -21,7 +21,6 @@ namespace System.Web.UI private HttpContext context; private string baseDir; private string baseVDir; - private string vPath; internal string MapPath (string path) { @@ -89,7 +88,7 @@ namespace System.Web.UI } } - internal string BaseVirtualDir { + internal virtual string BaseVirtualDir { get { if (baseVDir == null) baseVDir = UrlUtils.GetDirectory (context.Request.FilePath); @@ -97,12 +96,6 @@ namespace System.Web.UI return baseVDir; } } - - internal string CurrentVirtualPath { - get { return vPath; } - set { vPath = value; } - } } - } diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index 0188ec1e979..0c2d3f2969c 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,5 +1,16 @@ 2003-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * ApplicationFileParser.cs: store the Context and override + BaseVirtualDir so that it's the application path. + + * BaseParser.cs: removed CurrentVirtualPath property. + + * TemplateControlParser.cs: use BaseVirtualDir. + + * UserControlParser.cs: removed CurrentVirtualPath. + +2003-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com> + * TemplateParser.cs: always reference all the assemblies in bin directory. diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs index cc5b005ef9a..75f464a1a8d 100644 --- a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs +++ b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs @@ -88,8 +88,8 @@ namespace System.Web.UI "must be .ascx"); - AddDependency (Path.Combine (MapPath (CurrentVirtualPath), src)); - Type type = UserControlParser.GetCompiledType (CurrentVirtualPath, src, Context); + AddDependency (Path.Combine (MapPath (BaseVirtualDir), src)); + Type type = UserControlParser.GetCompiledType (BaseVirtualDir, src, Context); AddAssembly (type.Assembly, true); RootBuilder.Foundry.RegisterFoundry (tagprefix, tagname, type); return; diff --git a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs index 169f06b59c3..f47bf85d256 100644 --- a/mcs/class/System.Web/System.Web.UI/UserControlParser.cs +++ b/mcs/class/System.Web/System.Web.UI/UserControlParser.cs @@ -18,7 +18,6 @@ namespace System.Web.UI internal UserControlParser (string virtualPath, string inputFile, HttpContext context) { Context = context; - CurrentVirtualPath = virtualPath; InputFile = Path.Combine (context.Request.MapPath (virtualPath), inputFile); } |