annotate Agendas/trunk/src/Agendas.Web/Global.asax.cs @ 10:c62b77fc33f4

website inicial
author nelo@MTEySS.neluz.int
date Sun, 13 Mar 2011 18:51:06 -0300
parents
children 74eb4577d447
rev   line source
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
1 using System;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
2 using System.Collections.Generic;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
3 using System.Linq;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
4 using System.Web;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
5 using System.Web.Mvc;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
6 using System.Web.Routing;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
7
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
8 namespace Agendas.Web
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
9 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
10 // Note: For instructions on enabling IIS6 or IIS7 classic mode,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
11 // visit http://go.microsoft.com/?LinkId=9394801
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
12
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
13 public class MvcApplication : System.Web.HttpApplication
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
14 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
15 public static void RegisterGlobalFilters(GlobalFilterCollection filters)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
16 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
17 filters.Add(new HandleErrorAttribute());
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
18 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
19
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
20 public static void RegisterRoutes(RouteCollection routes)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
21 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
22 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
23
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
24 routes.MapRoute(
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
25 "Default", // Route name
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
26 "{controller}/{action}/{id}", // URL with parameters
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
27 new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
28 );
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
29
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
30 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
31
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
32 protected void Application_Start()
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
33 {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
34 AreaRegistration.RegisterAllAreas();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
35
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
36 RegisterGlobalFilters(GlobalFilters.Filters);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
37 RegisterRoutes(RouteTable.Routes);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
38 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
39 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
40 }