Wednesday, March 28, 2012

Validate a field

I have a very simple question.

I want to validate a textbox field by using the requiredfieldvalidator.

but that should only happen when i click on a particular button and not all the buttons.

i have a textbox for search and i don't want any blank values in that box so using validator, but i want to use the other buttons on the page.

pls help

Easily remedied :)

First set the validator's 'ValidationGroup' property to something that describes your validation. Eg. 'Search'

Then set the button's 'ValidationGroup' property to the same thing as the validator's so that it will fire only the validator you have defined.


Thanks a lot.....

No comments:

Post a Comment