public void Redirect(string url) { // TODO: This is a hack, better way to accomplish this? _response.SetStatus(HttpStatusCode.Redirect); _response.Headers.Add("Location", url); _response.Write(string.Format("<html><head><title>302 Found</title></head><body><h1>Found</h1><p>The document has moved <a href='{0}'>here</a>.</p></body></html>", url)); }
private static void write404(Response response) { response.SetStatus(HttpStatusCode.NotFound); response.Write("Sorry, I can't find this resource"); }
private static void write500(Response response, Exception ex) { response.SetStatus(HttpStatusCode.InternalServerError); response.Write("FubuMVC has detected an exception\r\n"); response.Write(ex.ToString()); }