RequiredFieldValidator switching on and off AND TextChanged events not firing

P

PromisedOyster

1. I have a series of RequiredFieldValidators that need to be be
enabled/disabled depending on what the user types into various text
boxes.

Can I do this using the Enabled property of the validator. Or should I
use the CausesValidation on the control?

2. Also, with my text boxes, I am not getting the TextChanged events
firing. I tried changing the AutoPostBack property on the text box to
true but this still did not fire the event? What am I doing wrong?

(Note it is within these TextChanged events that I am attempting to
disable the validators).

Sorry if this is a simple ASP.NET question but I have mostly been using
WinForms.
 
B

bgano

To answer your first question: yes, the Enabled property is how you turn
on/off validators.

As for the second question, setting AutoPostBack="true" and
OnTextChanged="..." should work. If you could post your code, it will
be easier for us to figure out what is going wrong.

-bgano
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top