What makes a control able to be validated?

  • Thread starter Thread starter Chris Kettenbach
  • Start date Start date
C

Chris Kettenbach

Does a control need to inherit an interface to be "validatable" :)? I have
a custom control ascx file. I want to name it as the control to be
validated by an asp:validator. When I do that, I get an error that says the
control can't be named as a controltovalidate. Any suggestions?

Thanks,
Chris
 
Hi Chris,

You can't validate a User Control using a standard ASP.NET validator
control. If you are trying to validate a Textbox, or something similar,
that is in the User Control, you will need to tell the validator the ID
of that control.

The following thread should answer your question:

http://tinyurl.com/7l6df

Hope this helps,

Tod Birdsall, MCSD for .NET
blog: http://tod1d.blogspot.com
 
User controls cannot be validated...
If you inherit a web control to build your own control,say by inheriting a
TextBox or ListBox class, validators will work on them.
 
Back
Top