Pretty Error URLs in MVC3 for 404, 500 Etc
pMy current error handling URLs look rather ugly:/p
precodehttp://localhost:65089/Error/NotFound?aspxerrorpath=/Foo /code/pre
pWould rather have something like this:/p
precodehttp://localhost:65089/Error/NotFound /code/pre pstrongWeb Config
Code/strong/p precodelt;system.webgt; lt;customErrors mode=On
defaultRedirect=~/Error/Unknowngt; lt;error statusCode=404
redirect=~/Error/NotFound /gt; lt;/customErrorsgt; /code/pre pstrongError
Controller/strong/p precode public class ErrorController : Controller { //
// GET: /Error/ public ActionResult Unknown() { return View(); } public
ActionResult NotFound() { return View(); } } /code/pre pThanks in
advance!/p
No comments:
Post a Comment