[System.Net] Add support for .pac proxy config scripts on mac
[mono.git] / mcs / class / System.Web / System.Web.UI / MasterPageParser.jvm.cs
index f9ac84753784664d32c5ab37e6d19a782165db5e..da72d87e945d030be71086918123f8dccdcb6757 100644 (file)
@@ -35,7 +35,7 @@ using System.Collections;
 using System.IO;
 using System.Web;
 using System.Web.Compilation;
-using System.Web.Util;\r
+using System.Web.Util;
 using System.Web.J2EE;
 
 namespace System.Web.UI
@@ -47,13 +47,19 @@ namespace System.Web.UI
                }
                
                public static MasterPage GetCompiledMasterInstance (string virtualPath, string inputFile, HttpContext context)
-               {\r
-                       string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath);\r
-                       Type tmpType = PageMapper.GetObjectType (resolvedUrl);\r
-                       if (tmpType == null)\r
+               {
+                       string resolvedUrl;
+                       if (VirtualPathUtility.IsAbsolute (virtualPath))
+                               resolvedUrl = virtualPath;
+                       else if (VirtualPathUtility.IsAppRelative (virtualPath))
+                               resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath);
+                       else
+                               resolvedUrl = VirtualPathUtility.Combine (VirtualPathUtility.GetDirectory (context.Request.FilePath, false), virtualPath);
+                       Type tmpType = PageMapper.GetObjectType (context, resolvedUrl);
+                       if (tmpType == null)
                                throw new InvalidOperationException ("Master page '" + virtualPath + "' not found");
-\r
-                       Object obj = Activator.CreateInstance (tmpType);\r
+
+                       Object obj = Activator.CreateInstance (tmpType);
                        return (MasterPage) obj;
                }