using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; using Newtonsoft.Json.Linq; namespace HH.WMS.WebUI { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{*allActiveReport}", new { allActiveReport = @".*\.ar12(/.*)?" }); routes.MapRoute( name: "Default",//新建Route的名称 url: "{controller}/{action}/{id}",//主要的映射关系 defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional },//默认参数,当映射不匹配时,会根据此参数进行Action匹配 namespaces: new[] { "HH.WMS.WebUI.Controllers" } ); ModelBinders.Binders.Add(typeof(JObject), new JObjectModelBinder()); //for dynamic model binder } } }