新创个MVC,然后启动,index,about都能打开,但我在Controllers自己建一个DefaultControllers并创建生成页面后,设为启动页,就会暴在页面上看到Server Error in '/' Application. The resource cannot be found.Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /Views/Home/Index.cshtml
http://localhost:2183/Views/Home/index.cshtml 这是报错的地址
用默认的是http://localhost:2183/Home/About 能正常打开请问怎么回事
http://localhost:2183/Views/Home/index.cshtml 这是报错的地址
用默认的是http://localhost:2183/Home/About 能正常打开请问怎么回事
好像是只要设为启动页面,地址都会变成http://localhost:2183/Views/Ddefault1/index.cshtml
... 为什么会这样
原因是启动起来,是不符合mvc,routing的可以在项目属性里设定启动的路径
路径格式是
http://localhost:2183/Home/Index
http://localhost:2183/Home/About
改成
http://localhost:2183/Home/Index