[英]MVC 5 Change the home page
我有按预期在本地运行的MVC5应用程序,当我运行它时会自动打开主页,我在视图中有额外的文件夹,我可以通过指定路径导航到它们(例如http://12.0.0.1:80/List/Index
)现在我想改变它,当我运行主项目( http://12.0.0.1:80
)时,它会自动打开页面http://12.0.0.1:80/List/Index
,我应该怎么做?
进入您的RouteConfig.cs
在文件App_Start
项目的文件夹,并更改默认的路由约束到controller="List"
,而不是controller="Home"
。
Use routes if you want the url to stay as http://12.0.0.1:80
but with the new content 如果您希望网址保持为
http://12.0.0.1:80
但使用新内容,请使用路由
Use redirect if you want the url to change to http://12.0.0.1:80/List/Index
如果您希望网址更改为
http://12.0.0.1:80/List/Index
请使用重定向
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.