Tuesday 29 March 2016

MVC - Fix the following error: The current request for action 'Index' on controller type '' is ambiguous between the following action methods:


Watch this example on YouTube:


The current request for action 'Index' on controller type '' is ambiguous between the following action methods:

To fix it replace
      public ActionResult Index(Customer model)
        {
            return View(db.Customers.ToList());
        }

with
      [HttpPost]
      public ActionResult Index(Customer model)
        {
            return View(db.Customers.ToList());
        }

No comments:

Post a Comment