How do I see Custom Contrrol properties in the designer?

C

chambersdon

How do I get the public properties of my custom control to show in the
designer. The properties are all Strings but they do not show up in
the designer property window.

My custom control inherits from:
System.Web.UI.UserControl

I have the following property:
Public Property workUnitCode() As String
....
End Property

I've tried putting the Browsable(true) tag but it does not help.

The custom control is in the same project with my page and I jsut drop
it onto the page. If I instantiate the control in the code-behind I
can see the properties.

Do I have to build the control in a dll and and include a reference to
that dll to make it work?
 
K

Ken Dopierala Jr.

Hi,

I always inherit from System.Web.UI.Control, not UserControl.

For my properties I have this:

<Browsable(True), Category("Stuff"),> _
Public Property FirstName() As String

For the properties I create custom designers for I use this:

<Browsable(True), Category("OtherStuff"),_
Editor(GetType(MyEditor), GetType(UITypeEditor))> _
Public Property FirstName() As String

Also be sure to add this line at the top of your control class:

Imports System.ComponentModel

Good luck! Ken.
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top