Custom Control won't appear in design mode?

D

Dave

Hi,

I created a custom control, regisitered it at the top of the page, and it works fine. However, it doesn't appear on the page during design mode as I've seen other controls or event ASP.NET controls (i.e PlaceHolder) as listed below

DESIGN MODE:

[ControlClass "ControlClass ID"]
or
[PlaceHolder "plcMyPlaceHolder"]
....
What do custom controls need to implement to show up on the design mode page like this?

Thanks, Dave.
 
H

Hardip Wadhwa

Expose some property and assign some value to it. Custom control will show
up in design mode.

Dave said:
Hi,

I created a custom control, regisitered it at the top of the page, and it
works fine. However, it doesn't appear on the page during design mode as
I've seen other controls or event ASP.NET controls (i.e PlaceHolder) as
listed below
DESIGN MODE:

[ControlClass "ControlClass ID"]
or
[PlaceHolder "plcMyPlaceHolder"]
...
What do custom controls need to implement to show up on the design mode page like this?

Thanks, Dave.
 
D

Dave

Thanks for the reply. But I think I'm already doing that. I'm creating a custom tabstrip control and create it on the page as:

<CustomTabStripControl:TABSTRIP id="TabStrip1" runat="server" DefaultTabId="TabOne">
<CustomTabStripControl:TAB id="TabOne" runat="server" />
<CustomTabStripControl:TAB id="TabTwo" runat="server" />
etc.

DefaultTabId is a public property that I define in TABSTRIP class as:

public string DefaultTabId
{
get
{
return _DefaultTabId;
}
set
{
_DefaultTabId = value;
}
}

Hardip Wadhwa said:
Expose some property and assign some value to it. Custom control will show
up in design mode.

Dave said:
Hi,

I created a custom control, regisitered it at the top of the page, and it
works fine. However, it doesn't appear on the page during design mode as
I've seen other controls or event ASP.NET controls (i.e PlaceHolder) as
listed below
DESIGN MODE:

[ControlClass "ControlClass ID"]
or
[PlaceHolder "plcMyPlaceHolder"]
...
What do custom controls need to implement to show up on the design mode page like this?

Thanks, Dave.
 
J

Jos

Dave said:
Hi,

I created a custom control, regisitered it at the top of the page,
and it works fine. However, it doesn't appear on the page during
design mode as I've seen other controls or event ASP.NET controls
(i.e PlaceHolder) as listed below

DESIGN MODE:

[ControlClass "ControlClass ID"]
or
[PlaceHolder "plcMyPlaceHolder"]
...
What do custom controls need to implement to show up on the design
mode page like this?

Thanks, Dave.

You need to add a class derived from ControlDesigner to your control,
and add this class as a DesignerAttribute to your control class.

The class should implement a GetDesignTimeHtml() method,
which allows you to produce whatever HTML you want to appear
in the designer.

See:
http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondesign-timeforwebforms.asp
 

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,571
Members
45,045
Latest member
DRCM

Latest Threads

Top