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
<system.web> | |
<httpRuntime relaxedUrlToFileSystemMapping="true"/> | |
... |
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
RouteTable.Routes.MapRoute( | |
"NotFound-Catch-All", | |
"{*any}", | |
new { controller = "NotFound", action = "NotFound" }); |
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
// To allow IIS to execute "/notfound" when requesting something which is disallowed, | |
// such as /bin or /app_data. | |
RouteTable.Routes.MapRoute( | |
"NotFound", | |
"notfound", | |
new { controller = "NotFound", action = "NotFound" }); |
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
routes.MapRoute( | |
"Default", | |
"{controller}/{action}/{id}", | |
new {controller = "Home", action = "Index", id = UrlParameter.Optional}); |
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
<error statusCode="404" subStatusCode="8" path="404.htm" /> |
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
<system.web> | |
<!-- For IIS 5 and 6, and the Visual Studio Development Server --> | |
<httpHandlers> | |
<add path="*" verb="*" | |
type="MvcErrorHandling.MvcHelpers.CustomHttpNotFoundHandler"/> | |
</httpHandlers> | |
</system.web> | |
... |
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
<system.web> | |
<httpRuntime relaxedUrlToFileSystemMapping="true"/> | |
... |
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
return new HttpNotFoundResult(); |
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
throw new HttpException((int)HttpStatusCode.NotFound, "A message"); |
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
if (HttpRuntime.UsingIntegratedPipeline) | |
{ | |
// TransferRequest approach. | |
} | |
else | |
{ | |
// MvcHttpHandler approach. | |
} |