The current request for action 'Index' on controller type ContactController
is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Index() on type RX.Web.Controllers.ContactController
System.Web.Mvc.ActionResult Index() on type RX.Web.Controllers.CustomControllerBase2[[RX.Core.Model.Contact, RXTechJob.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
The Contact Controller:
public virtual new ActionResult Index()
{
return base.Index();
}
The base Controller:
public virtual ActionResult Index()
{
return View("Index", SelectAll());
}
Why this happen? How to fix it? Thanks!
You are creating a second method called index that MVC does not know how to handle. see here for a discussion on virtual new
creating an additional not overriding method.
Instead for your contact controller consider something along the line of:
public override ActionResult Index() {
return base.Index();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With