标签:ret style index map ext route default net cti
//使用MVC app.UseMvc(routes => { routes.MapRoute( name: "areas", template: "{area:exists}/{controller=Home}/{action=Index}/{id?}" ); routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); //template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); });
新建Base控制器
[Area("Backstage")] public class BaseController : Controller { //public IActionResult Index() //{ // return View(); //} }
新建控制器
public class HomeController : BaseController { public IActionResult Index() { ContentResult content = new ContentResult(); content.Content = "text=0123456789"; return content; } }
访问: http://localhost:52768/backstage
标签:ret style index map ext route default net cti
原文地址:https://www.cnblogs.com/enych/p/12073749.html