How do I pass Url Parameters on a POST?

Posted by Robert Harvey on Stack Overflow See other posts from Stack Overflow or by Robert Harvey
Published on 2010-03-28T18:58:33Z Indexed on 2010/03/28 19:03 UTC
Read the original article Hit count: 188

Filed under:
|

I have a controller method with the following signature:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateValues(int id, MyViewModel[] array)
{
}

The id is normally picked up as part of the Url on other GET controller methods (I have a working route that does this)

I am successfully passing the array1 from the form in my view to the controller method, but how do I also put the id onto my Url so that when the user clicks the Submit button, the controller method will pick up the ID?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about c#