I have a problem to get a value of textbox which is in view into the controller.
In WebForms it was quite easy, it needed just to call textbox in codebehind trouhg Id,
but in MVC it seems not possible this way, or?
Help me please!
Take care,
Ragims
You need to post the form data back to the controller… when this happens, it attempts to map a property value handling the action method and auto assign it. So if you have:
In a form post, it will post to action method:
Or you can use a FormCollection instead
Which contains all of the values posted back.
But you have to post back, either via a form and clicking a submit button (only what’s in the form gets posted) or by using a JS library to post the form (like JQuery).