I am in vb.net. How do I set validating setting for a textbox control by codes? I would like to enable IsRequired and set custom notification text message based on conditions.
Something like:
Me.UltraValidator.SetValidationSettings(txtDBServer, .......)
Thank you.
bcsite,
This article in our online documentation provides detailed steps on how to set validation settings in code and also how to create custom text when there is a validation error. What this article does not cover is how to use the IsRequired property- in Step 2, rather than set the ValidationSettings' Condition property, set its IsRequired property to true.
Hope this helps,
~Kim~
Can you verify step 4 of that article you linked? Because when I try to set the e.notificationsettings.action in the validationerror event, it throws an error telling me that the notificationsettings instance is read-only and its properties cannot be modified.
Nevermind. It's because I'm doing a general Validate() call instead of one for a specific control.