I have the following ViewModel and i would like to create a custom binder to bind subclasses (LogOnModel, ChangePasswordModel).
public class LogOnViewModel
{
public string NextStep { get; set; }
public string PreviousStep { get; set; }
public string ReturnUrl { get; set; }
public bool MustChangePassword { get; set; }
public bool MustAgreeNewPrivacyStatement { get; set; }
public LogOnModel logOnModel { get; set; }
public ChangePasswordModel changePasswordModel { get; set; }
}
I was able to create my custom binder (inherit from DefaultModelBinder) but never was able to get a full VALIDATED model (ModelState populated) back into my controller. It's working fine for simple type (string, bool, ....) but a bit more complicated with complex type (subclass).
Is MVC 3 Futures the answer to my question or someone was able to override DefaultModelbinder to bind subclasses?
Thanks, Michel