【发布时间】:2014-09-15 06:32:21
【问题描述】:
在 MVC 4 应用程序中,我有 Nuget Umbraco CMS 7。
我需要保留一个非 Umbraco/自定义控制器的视图。我创建了一个名为 Users 的 MVC 控制器,它有一个名为 Index 的操作。我在 web.config 中更新了umbracoReservedUrls 如下:
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd,~/Users/Index" />
以下是我的控制器代码:
public class UsersController : Controller
{
//
// GET: /Users/
public ActionResult Index(User model)
{
return View(model);
}
}
我的视图标记如下:
@model Common.Model.User
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
问题:
在运行时,如果我导航到 http://localhost:56512/users/index,控制不会到达控制器,并且在浏览器中出现 404 错误,详情如下:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
您能否指导如何解决此问题并导航到非 Umbraco 视图和控制器?
【问题讨论】:
标签: .net asp.net-mvc-4 umbraco umbraco7 umbraco-mvc