S
Scott
Hi, I've got a problem where I'm trying to use the
HttpApplication.CompleteRequest() method to halt processing of an ASPX
page after doing a Response.Redirect in attempt to avoid a
ThreadAbortException.
The CompleteRequest method reportedly allows the currently executing
event handler (and any others associated with the event being handled)
to complete and then halts all other processing in the ASP.NET event
pipeline, jumping immediately to the Application_EndRequest event
instead. The problem is that the other events still seem to run. For
example, I call CompleteRequest in the OnInit method of a server
control, and the OnLoad method still gets executed. (I can tell
because I'm writing to the Event Log in both event handlers.) I can
see that OnLoad does, in fact, follow OnInit, so based on the described
behavior of CompleteRequest, this shouldn't be happening.
Of course, it's hard to find any Microsoft documentation on what this
method does, so some underlying assumptions could be wrong here. Does
anyone have any ideas what might be going on? Also, in case it might
matter, the page in question is being rendered out of a Sharepoint
Portal server. Sharepoint also prevents you from using Server.Transfer
too, so maybe I shouldn't be surprised that this doesn't work.
Still, any input would be greatly appreciated!
TIA,
-Scott
HttpApplication.CompleteRequest() method to halt processing of an ASPX
page after doing a Response.Redirect in attempt to avoid a
ThreadAbortException.
The CompleteRequest method reportedly allows the currently executing
event handler (and any others associated with the event being handled)
to complete and then halts all other processing in the ASP.NET event
pipeline, jumping immediately to the Application_EndRequest event
instead. The problem is that the other events still seem to run. For
example, I call CompleteRequest in the OnInit method of a server
control, and the OnLoad method still gets executed. (I can tell
because I'm writing to the Event Log in both event handlers.) I can
see that OnLoad does, in fact, follow OnInit, so based on the described
behavior of CompleteRequest, this shouldn't be happening.
Of course, it's hard to find any Microsoft documentation on what this
method does, so some underlying assumptions could be wrong here. Does
anyone have any ideas what might be going on? Also, in case it might
matter, the page in question is being rendered out of a Sharepoint
Portal server. Sharepoint also prevents you from using Server.Transfer
too, so maybe I shouldn't be surprised that this doesn't work.
Still, any input would be greatly appreciated!
TIA,
-Scott