// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.Web; using System.Web.Http; using System.Web.Mvc; using System.Web.Routing; namespace Demo { public class TestApplication : HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.Ignore("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Test", action = "List", id = UrlParameter.Optional }); } protected void Application_Start() { ViewEngines.Engines.Add(new RazorViewEngine()); RegisterRoutes(RouteTable.Routes); } } }