annotate Agendas/trunk/src/Agendas.Web/Global.asax.cs @ 19:74eb4577d447

HttpContext identity provider Requerimiento de autenticación para registrar un nuevo evento o modificar uno existente
author nelo@MTEySS.neluz.int
date Mon, 14 Mar 2011 00:35:43 -0300
parents c62b77fc33f4
children 475be11edf56
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.Mvc;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
5 using System.Web.Routing;
19
74eb4577d447 HttpContext identity provider
nelo@MTEySS.neluz.int
parents: 10
diff changeset
6 using Agendas.Factories;
10
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);
19
74eb4577d447 HttpContext identity provider
nelo@MTEySS.neluz.int
parents: 10
diff changeset
38
74eb4577d447 HttpContext identity provider
nelo@MTEySS.neluz.int
parents: 10
diff changeset
39 AgendaFactory.SetIdentityProvider(new HttpContextIdentityProvider());
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
40 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
41 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
42 }