mvc action name in url
Posted
by
Paul
on Stack Overflow
See other posts from Stack Overflow
or by Paul
Published on 2011-11-20T17:02:35Z
Indexed on
2011/11/20
17:54 UTC
Read the original article
Hit count: 223
asp.net-mvc-3
|Razor
UPDATE:
My model going into the save method is PartialViewModel, which in the save method, is pushed into the index's ContactViewModel and sent back. This wasn't clear.
I am playing around with MVC3, and have a contact controller with a SaveDetails action. The index cshtml has a partial with a form whose action is pointing to this controller.
When I submit the form not having completed it fully, thereby firing the validation, the url now contains the SaveDetails action name (http://localhost:7401/Contact/SaveDetails).
The form code is:
@using (Html.BeginForm("SaveDetails", "Contact")) {
...
}
The controller action looks like this:
public ActionResult SaveDetails(Models.PartialsViewModel pvm)
{
return View("Index", new ContactViewModel{ PartialsViewModel = pvm } );
}
What am I doing wrong?
© Stack Overflow or respective owner