Manish Pansiniya’s Blog

.NET, C#, Javascript, ASP.NET and lots more…:)

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

leave a comment »

 

I was working with the page and one silly mistake has taken my mind :P . Could not figure out at first sight but after debug, it would be found out.

I was doing Following:

try
{
    SaveShoppingInformation();
    RedirectToHome();
}
catch (Exception ex)
{
    throw new Exception("User Information: " + SessionHelper.UserInformation + ex.Message,ex);
}

Now the issue is, When you cover the exception on Response.Redirect, it gives the same error. Following is the solution.

try
{
    SaveShoppingInformation();
}
catch (Exception ex)
{
    throw new Exception("User Information: " + SessionHelper.UserInformation + ex.Message,ex);
}
RedirectToHome();

It resolves my issue :)

Written by Manish

July 14, 2009 at 9:49 am

Posted in .NET, .NET 3.0

Tagged with

Leave a Reply