hi,

Can you tell me plz how can i disable all the MaskEditExtender validator Control from the aspx page at once.

Thanks and Regards,
nice candy.

Recommended Answers

All 2 Replies

Member Avatar for stbuchok

I would assume you could do something like this (I haven't tested):

foreach (MaskedEditExtender mask in this.Controls)
{
	mask.enabled = false;
}

you would probably need to make sure that the control is a MaskedEditExtender before trying to do anything with it, then you can cast the control to the appropriate type

foreach (Control ctrl in this.Controls)
{
    if (ctrl is MaskedEditExtender)
    {
        (ctrl as MaskedEditExtender).enabled = false;
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.