Using Response.Redirect in a try catch block in C#.Net will throw an exception “Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.”.
To work around use the overloaded method Response.Redirect(String url, bool endResponse) and pass false to second argument. The detailed reason can be found at http://support.microsoft.com/kb/312629/EN-US/.
Add a Comment