routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new
{
controller = "ImageScan",
action = "ScanImage",
id = UrlParameter.Optional
},
namespaces: new[] { "WebApplication3.Controllers" });
我得到的错误:MVC 5 routeconfig错误
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.
请求的URL:/Views/ImageScan/ScanImage.cshtml
http:// localhost:64950/ImageScan/ScanImage 无法找到该资源。 描述:HTTP 404.您正在查找的资源(或其某个依赖项)可能已被删除,名称已更改或暂时不可用。请检查以下网址并确保它拼写正确。 请求的URL:/ ImageScan/ScanImage 的routeconfig被自动引导到以前的url..How使用合适的路由配置 –
里面我Layout.cshtml我使用 @ Html.ActionLink( “应用程序名称”, “ImageScan” “ScanImage”,新的{area =“”},新的{@class =“navbar-brand”}) –
删除'area'位。 – Amy