Would like to disable validation for entire page

M

Mike Hnatt

I'd like to conditionally enable or disable the page validation. I was
thinking something like;

Enummerate through all controls...if control is validation control type,
then control.ControlToValidate = ""

I think that would work but I don't know how to ennumerate through each
control and check to see if it is a validatior control or not. Also, would
this method even work?

Thanks,
Mike
 
M

Mike Hnatt

I found a solution, Here is what I did....

Dim ctl As Control
Dim pnl As Control
pnl = Page.FindControl("myPanel")
For Each ctl In pnl.Controls
If ctl.GetType.BaseType.Name.ToString =
"BaseValidator" Then
ctl.Visible = False
End If
Next
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top