I really appreciate all the help I am getting on here. And I apologise if I am asking really basic questions.
This is where I am at.
My Function on the code behind page now looks like this:
Code:
Protected Sub ValidateText10(ByVal sender As Object, ByVal args As ServerValidateEventArgs)
Dim numOfWords As String() = args.Value.Split(New Char() {" "c})
' args.IsValid = args.Value.Length <= 10
' args.IsValid = numofwords.Length <= 10
args.IsValid = args.Value.Length < 11
End Sub
The Validation now shows the Message Box correctly but if I enter anything in the text box it seems happy no matter what the length. I've tried several 'tests' as you can see but no matter how many characters I enter it does not complain.
I have not entered a MaxLength in the asp:ttextbox as I guess this would prevent the validation anyway by simply limiting the number of characters?