Update of /cvsroot/magicajax/magicajax/Core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7490/magicajax/Core
Modified Files:
MagicAjaxModule.cs
Log Message:
Added support for Response.Redirect for ASP.NET 2.0
Problem: In ASP.NET 2.0, no ThreadAbortException is thrown when a Response.Redirect is done in HttpContext.Current.Handler.ProcessRequest.
I solved this by checking if the request is being redirected, and call AjaxCallHelper.Redirect to output the 'redirecting' javascript.
Note: Server.Transfer for ASP.NET 2.0 isn't supported by MagicAjax yet.
Index: MagicAjaxModule.cs
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/MagicAjaxModule.cs,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** MagicAjaxModule.cs 24 Nov 2005 00:43:13 -0000 1.28
--- MagicAjaxModule.cs 24 Nov 2005 12:29:47 -0000 1.29
***************
*** 390,394 ****
_request = context.Request;
_response = context.Response;
! _magicAjaxContext = MagicAjaxContext.Current;
--- 390,394 ----
_request = context.Request;
_response = context.Response;
! _magicAjaxContext = MagicAjaxContext.Current;
***************
*** 476,479 ****
--- 476,492 ----
}
+ #if NET_2_0
+ // In ASP.NET 2.0, no ThreadAbortException is thrown when a Response.Redirect is
+ // done in HttpContext.Current.Handler.ProcessRequest. We solved this by checking
+ // if the request is being redirected, and output the redirecting javascript.
+ // Note: Server.Transfer for ASP.NET 2.0 isn't supported by MagicAjax yet.
+ if (_response.IsRequestBeingRedirected)
+ {
+ AjaxCallHelper.Redirect(_response.RedirectLocation);
+ _response.Flush();
+ return;
+ }
+ #endif
+
_response.Flush();
|