0

MVC 控制器中的操作参数是否遵循任何顺序或模式。例如:

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

控制器怎么知道这个特定的post参数是给catid等等的。

4

1 回答 1

1

尝试绑定catid参数时,默认模型绑定器会查找具有该名称的值。它查看表单值、路由数据、查询字符串和 http 文件集合。看看这个

于 2012-06-13T06:32:15.500 回答