我正在尝试进行HTTP 302重定向,但在调试模式下运行时出现以下异常。
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();
长话短说,这个调用没有刷新响应并且没有重定向。
我该如何使其工作?