2

Hi I have a model like this:

public class MyModel
{
  public string Header {get;set;}
  public IList<ChildModel> Children {get;set;}
}

public class ChildModel
{
  public string Name {get;set;}
  public bool IsDefault {get;set;
}

In the Create action of the controller I would like to have this:

public ActionResult Create(MyModel model)
{
  //...save...
}

It works for the Header property and for the Name properties of the child collection (I use Html arrays: Children[x].Name ), but the model binder doesn't set the value of the IsDefault property that is used with a RadioButton list.

Is there a way to get the strongly typed model correctly set using the radio buttons with the bool children? I don't want to implement a custom model binder for this...if possible.

thx

ema
  • 5,668
  • 1
  • 25
  • 31

0 Answers0