Arjel
Arjel

Reputation: 469

MVC Controllers parameters

Is there any order or pattern that action parameters in an MVC controller follow. For example:

[HttpPost]
public ActionResult AddFiles(HttpPostedFileBase file, int catid, string description)

How does the controller know that this certain post parameter is for catid and so on.

Upvotes: 0

Views: 88

Answers (1)

user840210
user840210

Reputation:

The default model binder when trying to bind the catid parameter looks for a value with that name. It looks in the form values, route data, query string and http file collection. Take a look at this.

Upvotes: 1

Related Questions