BMW
BMW

Reputation: 630

asp.net by pass RequiredFieldValidator validation

I have two buttons on my page and I want to trigger validator for only one of them not both.

I do not want the first button trigger RequiredFieldValidator I set UseSubmitBehavior="False" button it does not work for me

Upvotes: 0

Views: 245

Answers (1)

Sunny
Sunny

Reputation: 4809

Validation Groups allows to apply the validations for a group of controls. It works especially when there are multiple buttons on a page and if one button should trigger validations for set of controls and other button for another set. It can be achieved by setting validationgroup property to some string value on the validator controls along with button control.

Upvotes: 2

Related Questions