Skip to content

Instantly share code, notes, and snippets.

<system.web>
<!-- For IIS 5 and 6, and the Visual Studio Development Server -->
<httpHandlers>
<add path="*" verb="*"
type="MvcErrorHandling.MvcHelpers.CustomHttpNotFoundHandler"/>
</httpHandlers>
</system.web>
...
<error statusCode="404" subStatusCode="8" path="404.htm" />
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new {controller = "Home", action = "Index", id = UrlParameter.Optional});
// 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" });
RouteTable.Routes.MapRoute(
"NotFound-Catch-All",
"{*any}",
new { controller = "NotFound", action = "NotFound" });
<system.web>
<httpRuntime relaxedUrlToFileSystemMapping="true"/>
...
<httpErrors errorMode="Custom">
<error statusCode="404" subStatusCode="-1"
path="/notfound" responseMode="ExecuteURL" />
</httpErrors>
<system.web>
<!-- For IIS 6 -->
<httpHandlers>
<add path="*" verb="*"
type="NotFoundMvc.NotFoundHandler"/>
</httpHandlers>
</system.web>
...
@stevejay
stevejay / structuremapjobfactory
Created July 18, 2014 16:10
StructureMapJobFactory for Quartz.Net
using System;
using System.Globalization;
using Common.Logging;
using Quartz;
using Quartz.Spi;
using StructureMap;
using LogManager = Common.Logging.LogManager;
namespace Scheduler
{
@stevejay
stevejay / xstyled-system.d.ts
Last active May 27, 2021 05:23
TypeScript declaration file for @xstyled/system
// NOTE: This declaration file is now available on DefinitelyTyped: `npm install @types/xstyled__system`
// As a result, this gist is no longer being maintained.
/* eslint-disable @typescript-eslint/class-name-casing */
/* eslint-disable @typescript-eslint/no-explicit-any */
// Note: This is an early draft; there may be issues and a few typings use any.
// Acknowledgements:
// - The `styled-system` typings on DefinitelyTyped: