【发布时间】:2019-09-03 06:42:33
【问题描述】:
我正在尝试创建一个不同于 Index.cshtml 的主页
http(s)://localhost:5000 ==> 目前对应http(s)://localhost:5000/Index
在互联网上找到围绕同一概念的变体:
在 Startup.Configure 中从此改变
app.UseMvc();
到这里
app.UseMvc(routes =>
{
routes.MapRoute("default", "{controller=Home}/{action=Viewer}");
});
顺便问一下:Home 控制器在哪里?是隐含的吗?
【问题讨论】:
-
您想将哪个视图设置为默认视图,而不是索引视图?观众?
-
是的。我希望登陆页面是 http(s)://localhost:5000/ === http(s)://localhost:5000/Viewer
-
设置
routes.MapRoute("default", "{controller=Home}/{action=Viewer}");后不工作?
标签: asp.net-core-mvc website-homepage