asp.net-mvcModel binding

Download asp.net-mvc for free

Introduction

Model binding is the process of taking HTTP parameters, typically in the Query String of a GET request, or within POST body, and applying it into an object that can then be validated and consumed in an object-oriented manner without the need for Controller actions having intimate knowledge of how to retrieve HTTP parameters.

In other words, model binding is what allows actions, in MVC, to have either parameter(s), whether it being a value type or an object.

Remarks

To try to create instance in the action, the bind model process will search data in various places:

  • Form Data
  • Route Data
  • Query String
  • Files Custom (cookies for example)

Related Examples

Ajax binding