I have a partial view that is rendered within a main view. The partial view takes advantage of System.ComponentModel.DataAnnotations
and Html.EnableClientValidation()
.
A link is clicked, and div containing the partial view is displayed within a JQuery.Dialog()
.
I then click the save button without entering any text in my validated input field. This causes the client side validation to fire as expected, and display the '*required' message beside the invalid field.
When the cancel button is clicked, I want to reset the client side MVC validation back to it's default state and remove any messages, ready for when the user opens the dialog again. Is there a recommended way of doing this?