Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Unable to evaluate expression because the code is optimized or a native....

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.
by

2 Answers

Amit8z4mc
Request.Redirect(url,false);
false indicates whether execution of current page should terminate.
sandhya6gczb
Make second argument of Response false as shown below.

Response.Redirect(url,false);

Login / Signup to Answer the Question.