Disabling Required Field Validator

  • Thread starter Thread starter Sorin Sandu
  • Start date Start date
S

Sorin Sandu

I have a form with 2 textboxes, 2 required field validators for each
textbox, and 2 buttons (OK, Cancel)
Is it posible for cancel button to disable required field validators ?
 
I have a form with 2 textboxes, 2 required field validators for each
textbox, and 2 buttons (OK, Cancel)
Is it posible for cancel button to disable required field validators ?
Yes, the button class has a .CausesValidation property that you can set to
false
 
When I have to set this property ?
At the beginning of button.click event ?
"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> a scris în mesajul de
stiri:opscchtyfi75dg5d@cowboy...
I have a form with 2 textboxes, 2 required field validators for each
textbox, and 2 buttons (OK, Cancel)
Is it posible for cancel button to disable required field validators ?
Yes, the button class has a .CausesValidation property that you can set to
false
 
When I have to set this property ?
At the beginning of button.click event ?
"Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> a scris în mesajul de
stiri:opscchtyfi75dg5d@cowboy...

Yes, the button class has a .CausesValidation property that you can set
to
false

No, you set it immediately (when the page loads the first time) since I
assume it's always supposed to be false. You can do it either in the code
(in Page_Load when Not IsPostBack) or add an attribute of
CausesValidation="false" to the button in the .aspx
 
Back
Top