Update of /cvsroot/magicajax/magicajax/Core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13019/magicajax/Core
Modified Files:
MagicAjaxContext.cs MagicAjaxModule.cs
Log Message:
- Added property 'MagicAjaxVersion' to MagicAjaxContext object
- added MagicAjaxVersion in path to AjaxCallObject.js.aspx (so new versions of MagicAjax will force client to reload the new javascript)
Index: MagicAjaxContext.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxContext.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MagicAjaxContext.cs 4 Dec 2005 03:25:15 -0000 1.8
--- MagicAjaxContext.cs 11 Dec 2005 21:07:22 -0000 1.9
***************
*** 21,27 ****
--- 21,29 ----
using System;
+ using System.Diagnostics;
using System.Text;
using System.Web;
using System.Web.UI;
+ using System.Reflection;
using System.Configuration;
using MagicAjax.Configuration;
***************
*** 61,64 ****
--- 63,67 ----
private StoredPageInfo _storedPageInfo = null;
private MagicAjaxConfiguration _configuration = null;
+ private string _magicAjaxVersion = null;
#endregion
***************
*** 184,187 ****
--- 187,210 ----
((IsPageNoStoreMode && page.IsPostBack) || (!IsPageNoStoreMode && StoredPageInfo.Page == page)));
}
+
+ /// <summary>
+ /// Returns the current version of the MagicAjax dll
+ /// </summary>
+ public string MagicAjaxVersion
+ {
+ get
+ {
+ if (_magicAjaxVersion == null && HttpContext.Current != null)
+ {
+ object cachedMagicAjaxVersion = HttpContext.Current.Cache["__MAGIXAJAX_VERSION"];
+ if (cachedMagicAjaxVersion == null)
+ {
+ cachedMagicAjaxVersion = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion;
+ }
+ _magicAjaxVersion = (string)cachedMagicAjaxVersion;
+ }
+ return _magicAjaxVersion;
+ }
+ }
#endregion
Index: MagicAjaxModule.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** MagicAjaxModule.cs 10 Dec 2005 03:23:17 -0000 1.40
--- MagicAjaxModule.cs 11 Dec 2005 21:07:22 -0000 1.41
***************
*** 122,126 ****
#else
// src-request to "AjaxCallObject.js.aspx" will be handled by Application_BeginRequest, which returns the embedded AjaxCallObject.js script
! includeScript = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", "AjaxCallObject.js.aspx");
#endif
}
--- 122,126 ----
#else
// src-request to "AjaxCallObject.js.aspx" will be handled by Application_BeginRequest, which returns the embedded AjaxCallObject.js script
! includeScript = String.Format("<script type=\"text/javascript\" src=\"{0}/{1}\"></script>", MagicAjaxContext.Current.MagicAjaxVersion, "AjaxCallObject.js.aspx");
#endif
}
|