Response.End()
-
HI Response.End () giving This Error
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
Please How to solve?
-
HI Response.End () giving This Error
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
Please How to solve?
This is becasue, the
Response.End
method ends the page execution and shifts the execution to theApplication_EndRequest
event in the application's event pipeline. The line of code that follows Response.End is not executed. Resolution: ForResponse.End
, call theHttpContext.Current.ApplicationInstance.CompleteRequest
method instead ofResponse.End
to bypass the code execution to theApplication_EndRequest
event. Find the full detail here: ThreadAbortException [^] -
HI Response.End () giving This Error
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
Please How to solve?
Hi, If you use 1. Response.End,you should try ApplicationInstance.CompleteRequest 2. Response.Redirect,please change it to Response.Redirect(String url, bool endResponse),set endResponse as false. For example, Response.Redirect ("nextpage.aspx", false); 3. Server.Transfer,please change it to Server.Execute. Hope this helps:)