Я пытаюсь сделать HTTP 302 Redirect, но получаю следующее исключение, когда я работаю в режиме отладки.
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();
Короче говоря, этот вызов не сбрасывает ответ и не перенаправляет.
Как мне заставить это работать?