Relative Content

Tag Archive for validationblazor

ValidationSummary not displaying inside component

I have a dialog that has a Contact component. I pass in a Contact object from the dialog as a parameter to the component. The component maps the Contact properties to a ContactModel. I have a ValidationSummary, but it doesn’t display the messages. I verified that the EditContext is getting the ValidationMessageStore errors. After a bit of testing I have found that if you pass in any object, not just the model, then the ValidationSummary doesn’t work. I changed it to passing a contactId and that works, but now I’m getting the contact twice.

ValidationSummary not displaying inside component

I have a dialog that has a Contact component. I pass in a Contact object from the dialog as a parameter to the component. The component maps the Contact properties to a ContactModel. I have a ValidationSummary, but it doesn’t display the messages. I verified that the EditContext is getting the ValidationMessageStore errors. After a bit of testing I have found that if you pass in any object, not just the model, then the ValidationSummary doesn’t work. I changed it to passing a contactId and that works, but now I’m getting the contact twice.