Why doesnt 3 level nesting model binding from json work?
Testing with 2 levels, say adding a string property on LevelTwo, works, but 3 levels doesnt? Is this by design, a bug, or am I missing something?
Client side jQuery post:
$.ajax({
url: "MyController/MyAction",
dataType: "json",
type: "POST",
cache: false,
data: {
Level1: {
Level2: {
StringValue: "Test"
}
}
}
});
Server side model:
public class MyForm
{
public LevelOne Level1 { get; set; }
}
public class LevelOne
{
public LevelTwo Level2 { get; set; }
}
public class LevelTwo
{
public string StringValue { get; set; }
}