Files
yavsc/web/Global.asax.cs
Paul Schneider f695d108fb * Fixed the Pdf generation under Slackware
* Estimate view developpement
2014-11-03 16:55:09 +01:00

58 lines
1.5 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;
using Yavsc.Formatters;
namespace Yavsc
{
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes (RouteCollection routes)
{
routes.IgnoreRoute ("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute ("js/{*pathInfo}");
routes.IgnoreRoute ("Theme/{*pathInfo}");
routes.IgnoreRoute ("css/{*pathInfo}");
routes.IgnoreRoute ("images/{*pathInfo}");
routes.MapRoute (
"Blog",
"Blog/{user}/{title}",
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional }
);
routes.MapRoute (
"Blogs",
"Blogs/{action}/{user}/{title}",
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional}
);
routes.MapRoute (
"Default",
"{controller}/{action}/{user}",
new { controller = "Home", action = "Index", user="" }
);
}
protected void Application_Start ()
{
AreaRegistration.RegisterAllAreas ();
// add formatters : GlobalConfiguration.Configuration.Formatters.Add (new ZeroFormatter ());
GlobalConfiguration.Configuration.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{*id}",
defaults: new { controller = "WorkFlow", action="Index", id=0 }
);
RegisterRoutes (RouteTable.Routes);
}
}
}