asp.net-mvc – Umbraco 4.11.3 – 控制器类型的当前请求不明确
发布时间:2020-12-16 07:17:10 所属栏目:asp.Net 来源:网络整理
导读:我有一个全新安装的umbraco 4.11.3我正在尝试进行一个简单的控制器测试,但是有些事情对我来说是错误的.我创建了一个没有匹配模板的文档类型“Demo”.然后基于该Document类型调用名为“Demo”的内容项并更改此配置设置(defaultRenderingEngine – MVC)我添加
我有一个全新安装的umbraco 4.11.3我正在尝试进行一个简单的控制器测试,但是有些事情对我来说是错误的.我创建了一个没有匹配模板的文档类型“Demo”.然后基于该Document类型调用名为“Demo”的内容项并更改此配置设置(defaultRenderingEngine – > MVC)我添加了一个带有以下代码的新控制器.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Umbraco.Web.Models; namespace FrontEnd.Controllers { public class DemoController : Umbraco.Web.Mvc.RenderMvcController { // // GET: /Demo/ public ActionResult Index(RenderModel model) { return base.Index(model); } public ActionResult Demo(RenderModel model) { return View(model); } } } 我收到此错误: The current request for action 'Index' on controller type 'DemoController' is ambiguous between the following action methods: System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type FrontEnd.Controllers.DemoController System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Umbraco.Web.Mvc.RenderMvcController Exception Details: System.Reflection.AmbiguousMatchException: The current request for action 'Index' on controller type 'DemoController' is ambiguous between the following action methods: System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type FrontEnd.Controllers.DemoController System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Umbraco.Web.Mvc.RenderMvcController 关于在这里做什么的任何想法? 谢谢 解决方法
忘了提供覆盖,
public override ActionResult Index(RenderModel model) { return base.Index(model); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 错误的请求 – 无效的主机名ASP.NET MVC4
- asp.net mvc 2.0 Jquery表单提交
- asp.net – 获取Telerik RadScheduler当前视图的日期范围
- asp.net-mvc – ASP.NET MVC HandleError不工作(customErro
- asp.net MVC下使用rest的方法
- asp.net-mvc – 防止在asp.net MVC 3中验证部分表单
- ASP.NET MVC 3 – 如何以有效的方式限制区域?
- ASP.Net – 在jQuery填充列表后没有回发的项目
- 一步步开发自己的博客 番外篇(7、异步记录日志 和 文章阅读
- asp.net-core – IClaimsTransformer的User.IsInRole(“Adm
推荐文章
站长推荐
- asp.net – 如何从HttpClient.PostAsJsonAsync()
- asp.net-mvc – 在我自己的OWIN中间件中使用Ninj
- asp.net – 全局ASAX中的错误:文件不存在
- 文件上传 – 如何解决邮递员中的文件上传错误?
- asp.net-mvc-4 – 集成测试和单元测试(WEB API m
- asp.net – IIS 7如何使用数据库中的用户帐户映射
- asp.net-mvc – 我应该将ASP.NET MVC作为NuGet包
- ASP.NET MVC4中的PartialViews
- asp.net-mvc – 如何使用不同的名称绑定视图模型
- 在asp.net中按日期对directoryinfo中的文件进行排
热点阅读