weird designer behavior with composite controls...

K

Klaus Salchner

I have a custom control

public SmartToolbox : WebControl, INamingContainer

it does not override render...as we just create child controls we add to our
Controls collection

Label t = new Label();
t.Text = "ll";
Controls.Add(t);

Now, when I drag the control onto the designer...it does not render
itself...when I launch the app it renders nicely in IE. The only way how I
can get this control to render on the designer is to override OnInit

protected override void OnInit(...)
{
base.OnInit(...);
EnsureChildControls;
}

Now the next odd behavior is that when I expose a property called Text and
make it visible to the designer (property pane). I see the property, I can
change it and it persists in the HTML (I can see it). But I can't get the
designer to re-render itself to also show the updated text on the designer.
I can only do that by closing the designer and opening it again, which of
course triggers the OnInit above.

Can someone tell me what I am doing wrong here? Or is this a know issue of
the designer in VS.NET 2003?

Regards, Klaus
-----------------------------------------------
Klaus Salchner
email: (e-mail address removed)

Proud member of
http://linkedin.com - become part of my professional network; it's a free
3rd party tool
http://gotdotnet.com
http://theserverside.net
 

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

Latest Threads

Top