Thanks for your answer
I beleive your answer indicates to emit some HTML for showing the control in
design time, but still it will occupy space in the form designer ?
I thought it might be a possibility to make it a "component" (in the
component tray) because System.Web.UI.WebControls.WebControl inherits from
System.Web.UI.Control
which in turn inherits from (implements) IComponent, but I cannot find
anything useful there either.
Anyway, it is not a big problem, it just reminds me of the annoying way e.g.
Visual Basic 6.0 showed (runtime-invisible)components in the form and took
up some space :)
(but VB 6.0 didn't have any "component tray")
[quoted text, click to view] "Jos" <jnospambranders@fastmail.fm> wrote in message
news:elr05oBtEHA.2508@TK2MSFTNGP10.phx.gbl...
> Magne Ryholt wrote:
>> I have made a control based on System.Web.UI.WebControls.WebControl
>> which override the Render method to emit a script
>> (by using the Page.RegisterStartupScript() method)
>> This works fine.
>>
>> This control does not render any HTML code except the mentioned
>> script, therefore I would like to put the component (using VS.net
>> 2003) on the component tray instead of the form.
>> (otherwise it takes up space on thye form)
>>
>> Anyone knows if this is possible ?
>
> I don't think so.
> To get your control in the component tray, you need to
> derive from Component instead of WebControl.
>
> But Component doesn't have a Render method.
>
> However, you could associate your control with a class
> derived from ControlDesigner, which would just emit some
> small code to show in the designer. This would solve
> your problem.
>
> Look here:
>
http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/html/aspnet-adddesigntimesupport.asp
>
> --
>
> Jos
>
>
>