Dynamic validator Query

N

Nergal

Is it possible to add a validator at runtime and have it validate ?

I add a bunch of textboxes, validators etc dynamically and restore them on
postback but whatever I do the validator controls always return false for
IsValid.

TIA.
 
H

Hans Kesting

Nergal said:
Is it possible to add a validator at runtime and have it validate ?

I add a bunch of textboxes, validators etc dynamically and restore them on
postback but whatever I do the validator controls always return false for
IsValid.

TIA.

Yes it is possible. I generate some pages including validators
and they work fine. When are you adding those controls? It should
be in Page_Load (or maybe Page_Init).
 
N

Nergal

Yes it is possible. I generate some pages including validators
and they work fine. When are you adding those controls? It should
be in Page_Load (or maybe Page_Init).

Thanks for your reply.

I found the problem, the parent control was Visible = false; therefore the
validators always return true.

Thanks to reflector for uncovering that one ;)

Cheers
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top