Update of /cvsroot/magicajax/magicajax/Core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2409/magicajax/Core
Modified Files:
AjaxCallHelper.cs Util.cs
Log Message:
moved ResolveUrl() to Utils.cs
Index: Util.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/Util.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Util.cs 23 Nov 2005 15:12:48 -0000 1.6
--- Util.cs 23 Nov 2005 15:28:28 -0000 1.7
***************
*** 1,4 ****
--- 1,5 ----
using System;
using System.Collections;
+ using System.Web;
using System.Web.UI;
using System.Security.Cryptography;
***************
*** 17,21 ****
/// <param name="str"></param>
/// <returns></returns>
! static public string GetFingerprint(string input)
{
MagicAjax.Configuration.OutputCompareMode compareMode = MagicAjaxContext.Configuration.PageStore.CompareMode;
--- 18,22 ----
/// <param name="str"></param>
/// <returns></returns>
! public static string GetFingerprint(string input)
{
MagicAjax.Configuration.OutputCompareMode compareMode = MagicAjaxContext.Configuration.PageStore.CompareMode;
***************
*** 36,39 ****
--- 37,56 ----
/// <summary>
+ /// Resolves relative url's (starting with "~").
+ /// Use this when Control.ResolveUrl() is not available.
+ /// </summary>
+ /// <param name="url"></param>
+ /// <returns></returns>
+ public static string ResolveUrl(string url)
+ {
+ if (url != null && url.StartsWith("~") && HttpContext.Current != null)
+ {
+ string appPath = HttpContext.Current.Request.ApplicationPath.Length > 1 ? HttpContext.Current.Request.ApplicationPath : string.Empty;
+ url = appPath + url.Substring(1);
+ }
+ return url;
+ }
+
+ /// <summary>
/// Call a private method from the given object.
/// </summary>
Index: AjaxCallHelper.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/AjaxCallHelper.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** AjaxCallHelper.cs 23 Nov 2005 15:21:13 -0000 1.9
--- AjaxCallHelper.cs 23 Nov 2005 15:28:28 -0000 1.10
***************
*** 252,271 ****
}
}
-
- /// <summary>
- /// Resolves relative url's (starting with "~").
- /// Use this when Control.ResolveUrl() is not available.
- /// </summary>
- /// <param name="url"></param>
- /// <returns></returns>
- public static string ResolveUrl(string url)
- {
- if (url != null && url.StartsWith("~") && HttpContext.Current != null)
- {
- string appPath = HttpContext.Current.Request.ApplicationPath.Length > 1 ? HttpContext.Current.Request.ApplicationPath : string.Empty;
- url = appPath + url.Substring(1);
- }
- return url;
- }
#endregion
--- 252,255 ----
***************
*** 278,282 ****
{
Init();
! Write(String.Format("window.location.href=\"{0}\";\r\n", ResolveUrl(url)));
End();
}
--- 262,266 ----
{
Init();
! Write(String.Format("window.location.href=\"{0}\";\r\n", Util.ResolveUrl(url)));
End();
}
|