Skip to content

Instantly share code, notes, and snippets.

@imwower
Created July 30, 2014 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imwower/ce5a95a22ceb2283d011 to your computer and use it in GitHub Desktop.
Save imwower/ce5a95a22ceb2283d011 to your computer and use it in GitHub Desktop.
public class ErrorController : Controller
{
public ILogger Logger { get; set; }
public ActionResult Error(int code = 404, string redirectedUrl = "")
{
ViewBag.StateCode = code;
if (code == 401)
if (!string.IsNullOrEmpty(redirectedUrl))
return Redirect(redirectedUrl);
return View("Error");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment