asp.net.net-3.5response.redirect

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


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.


Solution

  • Make second argument of Response false as shown below.

    Response.Redirect(url,false);