MVC 路由问题,怎么才能指定某个URL用某个路由
1个回答
展开全部
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Type",
url: "{C}/{D}/{E}.html",
defaults: new { controller = "A", action = "B", C= @"[a-zA-Z0-9_]+", D= @"\d{8}", E= @"\d +" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}",
defaults: new { controller = "A", act
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Type",
url: "{C}/{D}/{E}.html",
defaults: new { controller = "A", action = "B", C= @"[a-zA-Z0-9_]+", D= @"\d{8}", E= @"\d +" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}",
defaults: new { controller = "A", act
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询