我想要路由到我的Companies
模型视图(Views/Companies/Employees/Edit)中的子文件夹中的Edit
页面。ASP.NET Core MVC中子文件夹的路由MVC
我试图在公司模型视图的Index.cshtml与链接http://localhost:xxxxx/Companies/Employees%2FEdit/1
打开一个空白页面使用<a asp-action="Employees/Edit" asp-route-id="@model.ID">Edit</a>
它做。正确的观点应该在http://localhost:xxxxx/Companies/Employees/Edit/1
。
任何人都可以向我解释为什么我得到这个?
这是Startup.cs:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
这是一个视图模型:) –