I want to close a modalDialog after the validator is shown in the browser (it is shown, it works) but I need to identifiy the case of failed server validation as to close the modal only in this case.
postbackRejected only occurs if the postback is cancelled before contacting the server โ it should be raised when client-side validation fails.
If server side validation fails, the postback proceeds normally, it will trigger the afterPostback event with arg.error.reason.type == "validation". The validation errors are applied at that point, you can just read the dotvvm.validation.errors.
In case youโd want to see all validation failures, Iโd just watch the dotvvm.validation.events.validationErrorsChanged event.
Except that my confirm modal does not close when returning to client-side even though I close it in code-behind prior to calling Context.FailOnInvalidModelState(); and Iโm forced to deal with closing it by script code.
But if server validation succeeds, the modal is closed when returning to client-side.