Author: krasnov
Date: 2007-01-01 04:58:59 -0500 (Mon, 01 Jan 2007)
New Revision: 70311

Modified:
   trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI/Control.cs
Log:
* Control.cs: fixed ResolveClientUrl, wrong when control that calls this method 
and the page are in different folders

Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-01-01 07:51:23 UTC 
(rev 70310)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog  2007-01-01 09:58:59 UTC 
(rev 70311)
@@ -1,3 +1,8 @@
+2007-01-01  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * Control.cs: fixed ResolveClientUrl, wrong when control that calls
+       this method and the page are in different folders
+
 2006-12-31 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * Page.cs: show the validation summary when client validation and

Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-01-01 07:51:23 UTC 
(rev 70310)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2007-01-01 09:58:59 UTC 
(rev 70311)
@@ -1147,23 +1147,12 @@
 #endif
                string ResolveClientUrl (string relativeUrl)
                {
-                       if (relativeUrl == null)
-                               throw new ArgumentNullException ("relativeUrl");
-
-                       if (relativeUrl == "")
-                               return "";
-
-                       if (relativeUrl [0] == '#')
-                               return relativeUrl;
-                       
-                       string ts = TemplateSourceDirectory;
-                       if (ts == "" || !UrlUtils.IsRelativeUrl (relativeUrl))
-                               return relativeUrl;
-
-                       HttpResponse resp = Context.Response;
-                       string absoluteUrl = resp.ApplyAppPathModifier 
(UrlUtils.Combine (ts, relativeUrl));
-                       if (absoluteUrl.StartsWith (ts + "/"))
-                               return absoluteUrl.Substring (ts.Length + 1);
+                       string absoluteUrl = ResolveUrl (relativeUrl);
+                       if (Context != null && Context.Request != null) {
+                               string baseUrl = Context.Request.BaseVirtualDir;
+                               if (absoluteUrl.StartsWith (baseUrl + "/"))
+                                       return absoluteUrl.Substring 
(baseUrl.Length + 1);
+                       }
                        return absoluteUrl;
                }
                

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

Reply via email to