Have trouble with the Response.Redirect()
and getting the error:
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
I've googled and found some topics here, like: Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
Where people are offering to set the 2nd argument to the false
value to make it work, like:
Response.Redirect("PageName.aspx", false);
But as for my program it isn't redirecting to the new one... It just continues to stay at this page.
I've done a breakpoint on other page, which to I want to redirect. But there wasn't any event for the breakpoint to catch. Looks like it just doesn't send the request to another page.
My code is rather big, so I've posted the code not here, but at ideone: http://ideone.com/bQzCJd
The Redirect()
method is on the 57th line
, which:
- occurs an exception, if the 2nd argument is set to
true
- nothing happen, if is set to
false
What must I do to fix it?