Does model binding work via query string as well ?
If I have a get request like :
GET /Country/CheckName?Country.Name=abc&Country.Id=0 HTTP/1.1
Would the following method in CountryController have its oCountry argument containing Id and Name properties with values from the query string ?
public ViewResult CheckCountryName(Country oCountry)
{
//some code
return View(oCountry);
}
For some reason I am getting Id as 0 and Name as null in oCountry object. What is missing ?
See Question&Answers more detail:os