summaryrefslogtreecommitdiffstats
path: root/samples/RelyingPartyMvc/Global.asax.cs
blob: 0659169e9012287597a657f2f61ee8d1dd52d65c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace RelyingPartyMvc {
	public class GlobalApplication : System.Web.HttpApplication {
		public static void RegisterRoutes(RouteCollection routes) {
			// Note: Change the URL to "{controller}.mvc/{action}/{id}" to enable
			//       automatic support on IIS6 and IIS7 classic mode

			routes.Add(new Route("{controller}/{action}/{id}", new MvcRouteHandler()) {
				Defaults = new RouteValueDictionary(new { action = "Index", id = "" }),
			});

			routes.Add(new Route("Default.aspx", new MvcRouteHandler()) {
				Defaults = new RouteValueDictionary(new { controller = "Home", action = "Index", id = "" }),
			});
		}

		protected void Application_Start(object sender, EventArgs e) {
			RegisterRoutes(RouteTable.Routes);
		}
	}
}