Groups | Blog | Home
all groups > asp.net webcontrols > october 2004 >

asp.net webcontrols : User Control not in available controls to validate


thadpeiffer
10/6/2004 8:41:05 AM
Hello!

Is it possible to create a web user control, drop it on a web page, and then
validate it using any of the validators other than the custom validator?
None of the controls that I've created show up in the DropDownList as being
able to be validated.

Thanks!
Peter Blum
10/7/2004 1:48:56 PM
Hi Thad,

Validators can only see the common data entry web controls (textbox, list,
dropdown, etc) within the same "naming container". A User control is a
unique naming container. A validator in another naming container (such as
the Page itself) cannot reference a data entry web control within a User
Control.

You have several choices:
1. Relocate the validator inside the naming container.
2. My replacement to Microsoft's validators, Professional Validation And
More (http://www.peterblum.com/vam/home.aspx), supports controls in
different naming containers. It includes 22 validators and they provide
client-side validation on many more browsers.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

[quoted text, click to view]

AddThis Social Bookmark Button