模型绑定也可以通过查询字符串工作吗?
如果我有一个get请求,比如:
GET /Country/CheckName?Country.Name=abc&Country.Id=0 HTTP/1.1
CountryController中的以下方法是否具有包含Id和Name属性的oCountry参数,这些属性具有来自查询字符串的值?
public ViewResult CheckCountryName(Country oCountry)
{
//some code
return View(oCountry);
}
由于某些原因,我在oCountry对象中得到Id为0,名称为null。遗漏了什么?
https://stackoverflow.com/questions/17329342
复制相似问题