Hi,
I have a regular expression validator on my webform and I am having trouble catching the control when it is invalid - what I want to do is the following:
Check if a given textbox validates against the regex
If so then do something
If the control is not validated then do something else
I have tried the following to validate the controls but it doesn't work
Any ideas how I can detect whether the control is valid or not and execute some code based on the result? Sorry haven't explained it well but its the best I can do.
I have a regular expression validator on my webform and I am having trouble catching the control when it is invalid - what I want to do is the following:
Check if a given textbox validates against the regex
If so then do something
If the control is not validated then do something else
I have tried the following to validate the controls but it doesn't work
Code:
SearchFieldRegex.Validate()
If Not SearchFieldRegex.IsValid Then
Do Something
Else
Do Something Else
End If
Any ideas how I can detect whether the control is valid or not and execute some code based on the result? Sorry haven't explained it well but its the best I can do.