Author: igorz
Date: 2008-01-17 10:34:56 -0500 (Thu, 17 Jan 2008)
New Revision: 93166

Modified:
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/Control.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
Log:
2008-01-17 Igor Zelmanovich <[EMAIL PROTECTED]>

        * Control.cs: fix ResolveUrl for some cases.



Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2008-01-17 15:34:20 UTC 
(rev 93165)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2008-01-17 15:34:56 UTC 
(rev 93166)
@@ -1,5 +1,9 @@
 2008-01-17 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * Control.cs: fix ResolveUrl for some cases.
+
+2008-01-17 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * Control.cs: consider changes in BaseCompiler.cs.
 
 2008-01-14 Igor Zelmanovich <[EMAIL PROTECTED]>

Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2008-01-17 15:34:20 UTC 
(rev 93165)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2008-01-17 15:34:56 UTC 
(rev 93166)
@@ -1272,20 +1272,29 @@
                        if (relativeUrl == null)
                                throw new ArgumentNullException ("relativeUrl");
 
-                       if (relativeUrl == "")
-                               return "";
+                       if (relativeUrl == String.Empty)
+                               return relativeUrl;
 
+                       if (VirtualPathUtility.IsAbsolute (relativeUrl))
+                               return relativeUrl;
+
                        if (relativeUrl [0] == '#')
                                return relativeUrl;
 
+#if NET_2_0
+                       string ts = AppRelativeTemplateSourceDirectory;
+#else
                        string ts = TemplateSourceDirectory;
+#endif
                        if (ts == null || ts.Length == 0 ||
                                Context == null || Context.Response == null ||
-                               !UrlUtils.IsRelativeUrl (relativeUrl))
+                               relativeUrl.IndexOf (':') >= 0)
                                return relativeUrl;
 
                        HttpResponse resp = Context.Response;
-                       return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, 
relativeUrl));
+                       if (!VirtualPathUtility.IsAppRelative (relativeUrl))
+                               relativeUrl = VirtualPathUtility.Combine 
(VirtualPathUtility.AppendTrailingSlash (ts), relativeUrl);
+                       return resp.ApplyAppPathModifier (relativeUrl);
                }
 
 

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs        
2008-01-17 15:34:20 UTC (rev 93165)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI/ControlTest.cs        
2008-01-17 15:34:56 UTC (rev 93166)
@@ -815,7 +815,6 @@
 
                [Test]
                [Category ("NunitWeb")]
-               [Category ("NotWorking")]
                public void ResolveUrl ()
                {
                        WebTest t = new WebTest (PageInvoker.CreateOnLoad 
(ResolveUrl_Load));
@@ -863,7 +862,6 @@
 
                [Test]
                [Category ("NunitWeb")]
-               [Category ("NotWorking")]
                public void ResolveUrl2 ()
                {
                        WebTest t = new WebTest ("ResolveUrl.aspx");

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to