-2
How to put two controllers with HTTPPOST
[HttpPost]
public ActionResult Index(string Nomel, string Utilizador, string Password, string PasswordC)
{
}
[HttpPost]
public ActionResult Index(string Nome, string Email, string Message)
{
}
The Current request for action 'Index' on controller type 'Homecontroller' is ambiguous between the following action methods: System.Web.Mvc.Actionresult Index(System.String, System.String, System.String, System.String) on type Cinel.Controllers.Homecontroller System.Web.Mvc.Actionresult Index(System.String, System.String, System.String) on type Cinel.Controllers.Homecontroller
That’s right, but that’s not called controller, it’s called action (action). What is your doubt?
– Jéf Bueno
If I put this it gives error only works if one is Post and the other get
– Amadeu Antunes
The answer was clear?
– Jéf Bueno
Not exactly, not quite sure what to do to fix
– Amadeu Antunes
You cannot have two actions with the same name and
HttpPost
, you need to change the name, or one should beHttpGet
– Ricardo Pontual
@Amadeuantunes Change name, young man.
– Jéf Bueno