Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Umbraco 4.11.3 - Current Request on controller type is ambiguous

I have a fresh install of umbraco 4.11.3 I'm trying to do a simple controller test with , but something went awry for me. I created a Document Type "Demo" with no matching template. Then a content item called "Demo" based on that Document type and change this config setting (defaultRenderingEngine --> MVC) I added a new controller with the code below.

 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);
    }
}
}

I get this error:

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

Any ideas on where to do for here?

Thanks

like image 701
MikeW Avatar asked Jan 16 '13 23:01

MikeW


1 Answers

Forgot to supply the override,

    public override ActionResult Index(RenderModel model)
    {
        return base.Index(model);
    }
like image 92
MikeW Avatar answered Sep 28 '22 22:09

MikeW