Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2063
  • Last Modified:

Error following MVC tutorial: The current request for action 'Create' on controller type 'HomeController' is ambiguous between the following action methods:

I am having the following error in Create when following the tutorial below:
The current request for action 'Create' on controller type 'HomeController' is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Create(System.Web.Mvc.FormCollection) on type ContactManager.Controllers.HomeController
System.Web.Mvc.ActionResult Create(ContactManager.Models.Contact) on type ContactManager.Controllers.HomeController

http://www.asp.net/mvc/tutorials/iteration-1-create-the-application-cs
0
DistillingExperts
Asked:
DistillingExperts
1 Solution
 
ToddBeaulieuCommented:
Hi. You can't have the same action name twice, even though they differ in signatures. MVC doesn't know how to route the request.
0
 
Fernando SotoRetiredCommented:
Hi DistillingExperts;

Did you place the attribute

    [AcceptVerbs(HttpVerbs.Post)]

above the, POST: /Home/Create, Action method?

Fernando
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now