Check required field in custom validator

A

Alex Shirley

Hi

I'm trying to check for a required field in a textbox using a custom
validator. I do not want to use a requiredfieldvalidator in this
instance.

I have tried the following code within the serverValidate handler and
it will not work:

If txtTheTextBox.Text.Trim <> "" Then
args.IsValid = True
else
args.IsValid = False
End If

.... and it refuses to work! Note serverValidate code does fire (I am
using other code as well in this custom validator and it works).
I don't think the blank string comparison is working.
Any ideas?

Thanks

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top