asp.net mvc Route路由--忽略路由 routes.IgnoreRoute
忽略路由配置路径:
/App_Start/RouteConfig.cs
代码
public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("WebServive/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } }
routes,IgnoreRoute("WebService/{*pathInfo}");
这句话的意思是所有请求以WebService开头的忽略路由,不通过MVC的路由,直接按照访问路径访问
qq:527592435