ASP.NET 2.0 - Response.Redirect error "Unable to evaluate expression ..."

Look at this:

Response.Redirect("~/ABC/Form/frmABC_GeneralInfo.aspx");

Does it looks like it will give you an error? You will be suprised on this one. Once a while, I am not sure why it happens once a while, you will get an exception like this:

ex = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

You will start scratching your head, what happened?

Just take it easy :) After investigating further online, I found out here http://support.microsoft.com/kb/312629/EN-US/

Thanks god it saved my life. What you should do or advised to do are ...

Response.Redirect("~/ABC/Form/frmABC_GeneralInfo.aspx", false); // Set false, as the 2nd argument

It worked fine now. It applies to Respond.End and Server.Transfer.

Thanks.

Published Friday, November 03, 2006 4:04 PM by chuawenching

Comments

# how to sell a home fast

Monday, May 19, 2008 7:31 AM by how to sell a home fast

The crisis was thus an accident waiting to happen. If it had not been triggered by the mispricing of securitized subprime mortgages