-2
我是新來的asp.net MVC。我添加了一個控制器並查看並設置路徑以查看我的索引頁。但它給了我下面的錯誤。MVC asp.net資源無法找到
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:/
如果你設置的路由,那麼請告訴我們您的路由配置和相關的控制器 – Marco
公共靜態無效的RegisterRoutes(RouteCollection路線) { routes.IgnoreRoute( 「{}資源個.axd/{*} PATHINFO」); routes.MapRoute( name:「Default」, url:「{controller}/{action}/{id}」, 默認值:new {controller =「Home」,action =「Index」,id = UrlParameter .Optional} ); – waleed
控制器是公共類Home1Controller:控制器 { // // GET:/ HOME1/ 公共的ActionResult指數() { 返回查看(); } } – waleed