How mvc model binder binds data to model and when I submit form or pass model to view.
//Action
public ActionResult ShowStudent()
{
Student student = new Student();
return View(student);
}
//View
@Html.TextBoxFor(x=>x.Name)
//Html Output in browser
<input type="text" id="Name" name="Name" value="" />
How this is happens in MVC? Please suggest me any book or link so that I can understand more about MVC.
x.Name
ended rendered as aninput
element whoseid
andname
were"Name"
. When the form is submitted and the URL has a "Name" parameter, it gets assigned tox.Name
. What is difficult with that? – SJuan76 Jul 26 at 20:18