views:

56

answers:

2

i need to post url to be /controller/action/someID

not sure how to get someID in using the BeginForm helper.

html.beginform("controller", "action", formmethod.post)
+4  A: 

I believe it will be:

Html.BeginForm("Controller","Action",new { someID = Model.SomeID }, FormMethod.Post);

...based on this overload from the FormExtensions in MVC.

Nick DeVore
A: 

Try this:

using (Html.BeginForm("controller", "action", new { id = 1234 }, FormMethod.Post))

That third parameter is routeValues.

Matt Sherman