Created
October 11, 2012 18:59
-
-
Save adautoneto/3874727 to your computer and use it in GitHub Desktop.
Web.Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ErrorController : Controller | |
{ | |
public ActionResult Index() | |
{ | |
return View(); | |
} | |
public ActionResult NotFound(string aspxerrorpath) | |
{ | |
return RedirectToAction("Index", "Home"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<customErrors mode="RemoteOnly" defaultRedirect="~/erro"> | |
<error statusCode="404" redirect="~/erro/naoencontrado" /> | |
</customErrors> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void RegisterGlobalFilters(GlobalFilterCollection filters) | |
{ | |
filters.Add(new HandleErrorAttribute()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minha versão: https://gist.github.com/4131799