From: Dion O. <dol...@us...> - 2005-12-22 19:18:57
|
Update of /cvsroot/magicajax/magicajax/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31465/magicajax/Core Modified Files: MagicAjaxModule.cs Log Message: - fix: ASP.NET 2.0 embedded resource only used when Context.Current.Handler is of type Page Index: MagicAjaxModule.cs =================================================================== RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** MagicAjaxModule.cs 22 Dec 2005 12:19:32 -0000 1.50 --- MagicAjaxModule.cs 22 Dec 2005 19:18:43 -0000 1.51 *************** *** 113,117 **** // Provides the location of the script file. string location = magicAjaxContext.Configuration.ScriptPath; ! string includeScript; // If script location is null, use embedded AjaxCallObject.js file --- 113,117 ---- // Provides the location of the script file. string location = magicAjaxContext.Configuration.ScriptPath; ! string includeScript = null; // If script location is null, use embedded AjaxCallObject.js file *************** *** 119,128 **** { #if NET_2_0 ! // Use the webresource url for AjaxCallObject.js ! includeScript = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", page.ClientScript.GetWebResourceUrl(typeof(MagicAjaxModule), "MagicAjax.script.AjaxCallObject.js")); ! #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 } else --- 119,133 ---- { #if NET_2_0 ! // Use the webresource url for AjaxCallObject.js (only for default Page HttpHandler) ! if (HttpContext.Current.Handler is Page) ! { ! includeScript = String.Format("<script type=\"text/javascript\" src=\"{0}\"></script>", page.ClientScript.GetWebResourceUrl(typeof(MagicAjaxModule), "MagicAjax.script.AjaxCallObject.js")); ! } ! #endif ! if (includeScript == null) ! { ! // 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"); ! } } else |