Advertisement
Guest User

Pastebin to the Rescue

a guest
Feb 9th, 2011
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. public class MvcApplication : System.Web.HttpApplication
  2.     {
  3.         public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  4.         {
  5. //            filters.Add(new HandleErrorAttribute());
  6.         }
  7.  
  8.         public static void RegisterRoutes(RouteCollection routes)
  9.         {
  10.             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  11.  
  12.             routes.MapRoute(
  13.                 "Default", // Route name
  14.                 "{controller}/{action}/{id}", // URL with parameters
  15.                 new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
  16.             );
  17.  
  18.         }
  19.  
  20.         protected void Application_Start()
  21.         {
  22.             AreaRegistration.RegisterAllAreas();
  23.  
  24.             RegisterGlobalFilters(GlobalFilters.Filters);
  25.             RegisterRoutes(RouteTable.Routes);
  26.         }
  27.  
  28.         protected void Application_AuthenticateRequest(object sender, EventArgs e)
  29.         {
  30.             // Do custom authentication...
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement