I am trying to make HTTP 302 Redirect, but I get the following exception while I am working in debug mode.
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
var response = HttpContext.Current.Response; response.Clear(); response.Status = "302 Found"; response.AddHeader("Location", "http://google.com"); response.End(); response.Flush();
In short, this call does not flush the answer, not redirect.
How can I make this work?
source share