I have page (Default1.aspx) in which I am redirecting to another page (Default2.aspx) using Server.Transfer() method. After the page processing completed in Default2.aspx, execution returns back to Default1.aspx, but at that time I’m getting the exception:
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
Why am I getting this and how can I avoid this when using the Server.Transfer() method?
Try using Server.Execute method instead. If it helps it might be that you are running into situation described at http://support.microsoft.com/kb/312629/en-us