using System; using System.Web.Mvc; using System.Web.Routing; namespace View_Engine_Demo { public class GlobalApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes) { routes.Add(new Route("{controller}/{action}", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { action = "Index" }) }); routes.Add(new Route("{controller}/{action}/{responseType}", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { action = "Index" }) }); routes.Add(new Route("Default.aspx", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "Home", action = "Index", id = "" }), }); } protected void Application_Start(object sender, EventArgs e) { RegisterRoutes(RouteTable.Routes); } } }