Ho una nuova installazione di umbraco 4.11.3 Sto provando a fare un semplice test del controller con, ma qualcosa è andato storto per me. Ho creato un tipo di documento "Demo" senza modello corrispondente. Quindi un elemento di contenuto chiamato "Demo" basato su quel tipo di documento e modificare questa impostazione di configurazione (defaultRenderingEngine -> MVC) Ho aggiunto un nuovo controller con il codice sottostante.Umbraco 4.11.3 - Richiesta corrente sul tipo di controller è ambigua
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);
}
}
}
ottengo questo errore:
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
Tutte le idee su dove fare qui?
Grazie
oops - il mio male. dimenticato di sovrascrivere il metodo di azione Indice. Funziona ora. – MikeW
Prendere in considerazione la risposta alla propria domanda e contrassegnarla come risposta. –