Search this blog

Tuesday, September 29, 2009

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

When I tried Execute the Following Code,


try
{
Response.Redirect(
"Default2.aspx");
}

catch (Exception Ex)
{
Response.Write(Ex.Message.ToString());
}

I got the following Error


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

I removed the try ... catch ... block, then I tried only with

Response.Redirect(
"Default2.aspx");

then it works fine. finally I came to know that Response.Redirect wont works with in
try ... catch ... block.

Hope it helps you too.

No comments:

Post a Comment