public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
不知道为什么在这个位置打开了http://localhost:00000/Views/Dashboard/Index.cshtml
什么能做到这一点?
最佳答案
试试这个
1) 右击你的项目解决方案
2)选择属性
3) 选择 Web 选项,然后选择当前页面
关于c# - 当我运行解决方案时,它打开的不是 mvc 中的默认页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38713261/