Hi,
The Model binder is responsible to map View Elements (HTML helpers) to the POCO model properties. It is the model binder which acts as a bridge between the View and the MVC models. Actually Model Binding is one of the best features in ASP.NET MVC framework. ModelBinder maps http requests from view data to the model.
We can see small examples like how it is effective and useful.
Controller
public ActionResult Index()
{
return View();
}
Now we can create the Model File,
Public class DemoModel
{
public int StudentId { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public int Marks { get; set; }
}
Now we can Bind this model in the CSHTML file. Which is tightly coupled Datatype.
@model CustomModelBinding.Models.DemoModel
Mani.R
Kasani007, if this helps please login to Mark As Answer. | Alert Moderator