Disabling Required Field Validator

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 ?
 
C

Craig Deelsnyder

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
 
S

Sorin Sandu

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:eek:pscchtyfi75dg5d@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
 
C

Craig Deelsnyder

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:eek:pscchtyfi75dg5d@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
 

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,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top