Accepty Properties in Property Box for Custom Validator Control

V

Vinod I

Hi Team,

I made a custom validator control which is having 2 public properties. But
after making dll & adding that to the ToolBox, I could not able to find
these properties in Property Box.

Can any body explain me where am I wrong ? Also, if I want to make this
control as like other validator control, e.g. to skip the "Registering on
the Page", wat should I do ?

web site name which explains all these aspects really appreciated.

Thanks in advance

Cheeeeeeeeers !!!!!!!!!
 
P

Peter Blum

In order to add properties, you had to subclass from something. Typically a
CustomValidator isn't used to subclass; BaseValidator is. If you subclass
from BaseValidator, you can add Public properties that will automatically
appear in the Properties Editor UNLESS you explicitly add the
BrowsableAttribute(false) to each of these properties. I doubt you did that.

Visual Studio.net automatically does several things for you when you
subclass from ANY System.Web.UI.Control class:
1. It adds the <@ Register > tag to the form when the control is dragged and
dropped from the toolbox
2. It adds a reference to the assembly into the Project
3. It provides some visual appearance (which you can enhance) in design
mode. BaseValidator will provide all the visual appearance you need for any
new validator.
4. Its properties editor shows every public property not already hidden by
that BrowseableAttribute set to false.

I would recommend deleting the controls from the VS.NET toolbox. Restarting
VS.NET and adding them again. I would also recommend testing this process in
a new web application on a new form in case there is something incorrect
about your existing project.

You may want to post code that shows what you have subclassed from and the
property definitions.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top