PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using System.Web.Routing;
  7. namespace $safeprojectname$
  8. {
  9. // Note: For instructions on enabling IIS6 or IIS7 classic mode,
  10. // visit http://go.microsoft.com/?LinkId=9394801
  11. public class MvcApplication : System.Web.HttpApplication
  12. {
  13. public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  14. {
  15. filters.Add(new HandleErrorAttribute());
  16. }
  17. public static void RegisterRoutes(RouteCollection routes)
  18. {
  19. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  20. routes.MapRoute(
  21. "Default", // Route name
  22. "{controller}/{action}/{id}", // URL with parameters
  23. new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
  24. );
  25. }
  26. protected void Application_Start()
  27. {
  28. AreaRegistration.RegisterAllAreas();
  29. RegisterGlobalFilters(GlobalFilters.Filters);
  30. RegisterRoutes(RouteTable.Routes);
  31. }
  32. }
  33. }