Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Suppress exception
Message
From
09/01/2014 01:25:16
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01591488
Message ID:
01591550
Views:
32
Hi
I tried the suggestion
For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method 
instead of Response.End to bypass the code execution to the Application_EndRequest event.
For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse) that 
passes false for the endResponse parameter to suppress the internal call to Response.End. For example:
The problem is, HttpContext.Current.ApplicationInstance.CompleteRequest doesn't actually stop the execution. The rest of code (same layer or caller layer( after this method call will be still been executed, which I don't want to.

For Response.Redirect(String url, bool endResponse), it will still cause caller method able to catch ThreadAbortedException.
Most importantly, my redirect method would be called during callback. Which Response.Redirect() would not work.
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform