PageRenderTime 41ms CodeModel.GetById 20ms app.highlight 2ms RepoModel.GetById 14ms app.codeStats 0ms

/Source/Visual Studio/WebApp/Global.asax.cs

#
C# | 40 lines | 31 code | 7 blank | 2 comment | 0 complexity | 50518489a4837827eb3910cbfb29b8db MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Web;
 5using System.Web.Mvc;
 6using System.Web.Routing;
 7
 8namespace $safeprojectname$
 9{
10    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
11    // visit http://go.microsoft.com/?LinkId=9394801
12
13    public class MvcApplication : System.Web.HttpApplication
14    {
15        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
16        {
17            filters.Add(new HandleErrorAttribute());
18        }
19
20        public static void RegisterRoutes(RouteCollection routes)
21        {
22            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
23
24            routes.MapRoute(
25                "Default", // Route name
26                "{controller}/{action}/{id}", // URL with parameters
27                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
28            );
29
30        }
31
32        protected void Application_Start()
33        {
34            AreaRegistration.RegisterAllAreas();
35
36            RegisterGlobalFilters(GlobalFilters.Filters);
37            RegisterRoutes(RouteTable.Routes);
38        }
39    }
40}