I am getting an error in my asp.net app that reads
"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."
protected void btnCustomerProfile_Click(object sender, EventArgs e)
{
try
{
Server.Transfer("CustomerProfile.aspx");
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
finally
{ }
}
After searching SO, I see most of the similar posts involve response.redirect. My code is using server.transfer and my application is also using Master Pages.
How can I resolve this issue?
Update: For some reason, this error occurs is I use Response.Redirect as well. Unfortunately I cannot use Server.Execute, because Server.Execute calls the calling page towards the end.
Response.End
... But looking at your code is very difficult to say what's the cause of this issue... – Petersham