Composite vs non composite Controls

M

Mike

Hi,
Which are the differences between Composite and non composite Controls? With
Composite Controls is possible view the control at DesingTime?

Thanks!
 
J

Josh

A Composit control simply consists of more than one control enclosed in a
single "user control" or "web control" . You cant view Usercontrols in the
designer of Visual Studio but you can in other development environments etc
 
J

JV

A composite control is composed of multiple HTML tags (or controls if you
will) rather than rendering to just one.

Viewing the control at design time is no problem for a "Web Custom
Control". It just has to render properly. A "Web User Control" is
different and does not render anything useful at design time. But it's
easier to create.
 
M

Mike

OK,
I made WebCustomControl but there are two ways to insert controls, 1) is
overriding Render methods and insert a string with HTML format 2) overriding
the CreateChildControls and insert controls to the Controls collection. Ok,
if I override the Render method i can see the control at desing time when
put it from the ToolBar, buut if I override the CreateChildControls and
insert the controls to the Controls Collection I can't see the Control at
DesignTime, but I can in Internet Explorer.
Isn't possible see the control at design time if I would do it overriding
CreateChildControls methods?

Thanks
 
S

Sundararajan

Dear Mike,
U can render ur own html that should appear at design time when the
composite control created by overriding Create child controls is dragged into
the web forms. for that u have to write a custom control designer class thats
inheritied from System.Web.UI.Design.ControlDesigner class . you override the
GetDesignHtml(), GetEmptyDesignHTML method to render ur own html that should
be shown in the design view.

then bind your Custom controlDesigner class to ur custom web control class
by specifying the ControlDesigner attribute in your web control.

Hope this helps

Regards,
Sundararajan.S
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top