一、普通路由
1、修改Controller路由
[RoutePrefix("news")] //修改Controller路由 public class ProductController : Controller
2、修改action路由
[Route("bs")] public ActionResult Brand()
二、区域路由
1、默认路由
区域area:m
public class ProductController : Controller { public ActionResult Test() { return View(); } }
默认地址:/m/product/test
2、自定义路由
[RouteArea("m", AreaPrefix = "mm")] //修改area路由 [RoutePrefix("news")] //修改Controller路由 [Route("{action}")] public class ProductController : Controller { [Route("tt")] public ActionResult Test() { return View(); } }
自定义路由后地址:/mm/news/tt
三、常见路由大全
https://www.cnblogs.com/weihengblogs/p/8876944.html
标签:ProductController,Asp,Route,Controller,MVC,news,Net,public,路由 From: https://www.cnblogs.com/webapi/p/16824118.html