环境:asp.net mvc 项目,遇到这个问题让我很是纳闷,却总找不到是哪的错误?
先贴出路由配置:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.MapRoute(
name:="Manage", url:="Manage/{action}/{type}/{id}", defaults:=New With {.controller = "Manage", .action = "Index", .id = UrlParameter.Optional}
)
routes.MapRoute(
name:="Default", url:="{controller}/{action}/{id}", defaults:=New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional}
)
在出现问题之前我的一些地址都是可以正常访问的,比如一下:
http://localhost:13599/Manage/Area/Edit/c0decdec-8713-e311-9b26-3883450033e4
http://localhost:13599/Manage/Category/Create
http://localhost:13599/Manage/Categories?TypeID=e2decdec-8713-e311-9b26-3883450033e4
http://localhost:13599/Manage/Category/Create?TypeID=e2decdec-8713-e311-9b26-3883450033e4
我中manage控制器中又添加了一个action:其中一个参数 type 为 completed,返回的视图名称为:video_publishcompleted
这个时候的页面地址为:
http://localhost:13599/Manage/Video/Completed/2d94414a-f213-e311-9b26-3883450033e4
这个时候问题出现了,其他页面都正常,唯独这个提示错误:
The view 'Video_PublishCompleted' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Manage/Video_PublishCompleted.aspx
~/Views/Manage/Video_PublishCompleted.ascx
~/Views/Shared/Video_PublishCompleted.aspx
~/Views/Shared/Video_PublishCompleted.ascx
~/Views/Manage/2d94414a-f213-e311-9b26-3883450033e4.master
~/Views/Shared/2d94414a-f213-e311-9b26-3883450033e4.master
~/Views/Manage/2d94414a-f213-e311-9b26-3883450033e4.cshtml
~/Views/Manage/2d94414a-f213-e311-9b26-3883450033e4.vbhtml
~/Views/Shared/2d94414a-f213-e311-9b26-3883450033e4.cshtml
~/Views/Shared/2d94414a-f213-e311-9b26-3883450033e4.vbhtml
大家看看是哪出的问题,视图?还是路由配置?还是控制器的方法?
人要诚实!还要踏实! 我先为人人,人人再为我! 我的Spaces: http://mydodu.spaces.live.com/