2007-05-02 Igor Zelmanovich <igorz@mainsoft.com>
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Wed, 2 May 2007 09:45:24 +0000 (09:45 -0000)
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>
Wed, 2 May 2007 09:45:24 +0000 (09:45 -0000)
* Control.cs:
ResolveClientUrl considers TemplateSourceDirectory property.

svn path=/trunk/mcs/; revision=76558

mcs/class/System.Web/System.Web.UI/ChangeLog
mcs/class/System.Web/System.Web.UI/Control.cs

index 3ee65d065d75a7768e4fbe554fbacdfe6ca840aa..7c08fd16411b0e65b90d498a91db6ef0fdf9b2ad 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-02 Igor Zelmanovich <igorz@mainsoft.com>
+
+       * Control.cs:
+       ResolveClientUrl considers TemplateSourceDirectory property.
+
 2007-05-01  Marek Habersack  <mhabersack@novell.com>
 
        * PageParser.cs: clientTarget comparisons must be case-insensitive
index 153a4b721ccb51778036e89fc91444a829853e17..e5db6f1d3f7d3107ae8e91caf70635565e0ce7ba 100644 (file)
@@ -1204,7 +1204,11 @@ namespace System.Web.UI
                        if (relativeUrl.Length == 0)
                                return String.Empty;
 
-                       if (Context != null && Context.Request != null && VirtualPathUtility.IsAppRelative (relativeUrl)) {
+                       if (VirtualPathUtility.IsAbsolute (relativeUrl) || relativeUrl.IndexOf (':') >= 0)
+                               return relativeUrl;
+
+                       if (Context != null && Context.Request != null && TemplateSourceDirectory != null) {
+                               relativeUrl = VirtualPathUtility.Combine (VirtualPathUtility.AppendTrailingSlash (TemplateSourceDirectory), relativeUrl);
                                string basePath = Context.Request.FilePath;
                                if (basePath.Length > 1 && basePath [basePath.Length - 1] != '/') {
                                        basePath = VirtualPathUtility.GetDirectory (basePath);