Skip to content

Instantly share code, notes, and snippets.

@adautoneto
Created October 11, 2012 18:59
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 adautoneto/3874727 to your computer and use it in GitHub Desktop.
Save adautoneto/3874727 to your computer and use it in GitHub Desktop.
Web.Config
public class ErrorController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult NotFound(string aspxerrorpath)
{
return RedirectToAction("Index", "Home");
}
}
<customErrors mode="RemoteOnly" defaultRedirect="~/erro">
<error statusCode="404" redirect="~/erro/naoencontrado" />
</customErrors>
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
@Ridermansb
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment