I want to transfer something like the following from my controller: GET not POST:
public class MyDTO
{
public string val1 { get; set; }
public string val2 { get; set; }
public MyObject obj { get; set; }
}
public class MyObject
{
public int SomeInt { get; set; }
public string ACoolValue { get; set; }
public string YetAnotherCoolValue { get; set; }
}
And then the dispatcher will like it like that. (Note that this is a GET):
public ActionResult MyView(MyDTO dto)
{
return View(dto)
}
The problem is that the MyObject instance is returned as null, where val1 and val2 have data. Does anyone come across this?
source
share