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

Radhi picture Radhi · Jan 11, 2010 · Viewed 275.4k times · Source

I am getting the error:

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

I have redirected to a new page in repeater's itemcommand event. The error occurs at the line:

string url = "~/Galleries/AlbumImageList.aspx?UId=" + this.UserId.ToString() + "&AlbumId=" + e.CommandArgument.ToString();
Response.Redirect(url);

Can anybody please help me? Is anything wrong there? The _COMPlusExceptionCode is -532459699.

Answer

PrateekSaluja picture PrateekSaluja · Oct 1, 2010
Request.Redirect(url,false);

false indicates whether execution of current page should terminate.