Home All Groups Group Topic Archive Search About

Enter text in at least one textbox

Author
6 Dec 2006 9:16 PM
Tigers21
I want to check if at least one of my two textboxes has an entered value....
If none of them has a value, I want a validator to show an errormessage....

How do I do that?

Author
8 Dec 2006 8:40 PM
Brennan Stehling
You can implement a CustomValidator.  Drag it onto your web form from
the toolbox.  The handle the ServerValidate and in that method set the
args.IsValid property based on your logic.

http://msdn2.microsoft.com/en-us/library/9eee01cx.aspx

Brennan Stehling
http://brennan.offwhite.net/blog/


Tigers21 wrote:
Show quoteHide quote
> I want to check if at least one of my two textboxes has an entered value....
> If none of them has a value, I want a validator to show an errormessage....
>
> How do I do that?