John
John

Reputation: 3945

how do i post back value of input?

Using mvc I am trying to post a value back to the post function.

<input id="Order" name="NoToOrder" type="text" value="0" onchange=""/>
<button type="submit" name="command" value="Save">Order</button>

so In the controller what do I use as a parameter to get the value of the input?

 public ActionResult OrderManufacturedProductsPOST(int Order)

??

EDIT: Iv checked view source

any idea?s

Upvotes: 0

Views: 90

Answers (1)

AgentFire
AgentFire

Reputation: 9780

Yes, you are right. The parameter name should be the name of an input element.

Form's action should be also the action method's name.

Add name attribute:

<input id="Order" name="Order" type="text" value="0" />

Upvotes: 2

Related Questions