I am using RC2
Using URL Routing:
routes.MapRoute(
\"Error\",
\"{*url}\",
new { controller = \"Errors\", action = \"N
My solution, in case someone finds it useful.
In Web.config:
...
In Controllers/ErrorController.cs
:
public class ErrorController : Controller
{
public ActionResult PageNotFound()
{
if(Request.IsAjaxRequest()) {
Response.StatusCode = (int)HttpStatusCode.NotFound;
return Content("Not Found", "text/plain");
}
return View();
}
}
Add a PageNotFound.cshtml
in the Shared
folder, and that's it.