How to create 303 Response in asp.net
-
14-11-2019 - |
Question
Does anyone know how to redirect current request in ASP.NET using http status code 303 (SeeOther).
Code snippets are more than welcome!
Solution
You should be able to do it like this:
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Status = "303 See Other";
HttpContext.Current.Response.AddHeader("Location", newLocation);
HttpContext.Current.Response.End();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow