I have a form which posts these values:
survey[0].Key 75
survey[0].Value 4
survey[1].Key 76
survey[1].Value 4
I'm trying to use a default model binder to map it onto Dictionary type:
[HttpPost]
public ActionResult CompleteSurvey(Dictionary<int, int> answers)
{
...
}
but I get InvalidCastException: Specified cast is not valid.
Why??