Firstly, this is a great library, it's the exact tool I needed for what I'm trying to do.
But I'm having problems getting validation to work on my dynamic form. Basically I have a list of validation errors generated from a service and I'm wondering if I can apply them to a dynamic form created from an PropertyVm[].
Looking at the Form.Property.cshtml it looks like it's calling AllValidationMessages to display the validation. And that method is relying on ModelState[modelName].Errors to get the validation.
I tried calling ModelState.AddModelError in my controller, but they do not appear to be showing up in the Form.Property view's ModelState.
Is there something here I am missing? Or a better way to accomplish this?
Firstly, this is a great library, it's the exact tool I needed for what I'm trying to do.
But I'm having problems getting validation to work on my dynamic form. Basically I have a list of validation errors generated from a service and I'm wondering if I can apply them to a dynamic form created from an
PropertyVm[]
.Looking at the
Form.Property.cshtml
it looks like it's callingAllValidationMessages
to display the validation. And that method is relying onModelState[modelName].Errors
to get the validation.I tried calling
ModelState.AddModelError
in my controller, but they do not appear to be showing up in theForm.Property
view'sModelState
.Is there something here I am missing? Or a better way to accomplish this?