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的路由,直接按照访问路径访问

posted @ 2019-10-16 10:57  橙-极纪元JJYCheng  阅读(618)  评论(0编辑  收藏  举报