Refreshing web-control in designer

G

Guest

Hello,

I have a web control I have developed that is derived from composite
control. On it, I have a property that is called IsBlahBlahVisibile.
When this property changes, it is supposed to hide or show a control
that is contained by it. I have associated a CompositeControlDesigner
class with the said web control, and overrode a single function
GetDesignTimeHtml. All this function does is renders the web control
to an HtmlTextWriter object and returns it as a string. When I debug
into this code using another instance of VS, the code is indeed called
and the property value IsBlahBlahVisible has the correct value when I
change that property in the designer. However, the design page is not
updated and the control is not redrawn. How do I get this control to
redraw when I change the property?

I have tried setting the RefreshProperties attribute and that doesn't
work. I've tried setting the NotifyParentProperty and that doesn't
work.

If I go from source view, back to design view after changing the
property, the control is redrawn and it appears correctly. But, I
would like to update the design time view for the control as soon as
the property value changes.

Where in the .NET Framework infrastructure do I need to update code so
that this above said functionality works?

Thanks,

Hammad
 
O

offwhite

I think this article will help you out.

http://msdn.microsoft.com/library/e...ETContDev.asp?frame=true#aspnetcontdev_topic5

The articles by Dino Esposito are the best on that topic I have read.

Make sure you are calling EnsureChildControls each time you change a
property. That may be your exact issue.

This article may also be useful.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ASPNETContDev.asp

Pay attention to what he writes about EnsureChildControls and
ChildControlsCreated.

Brennan
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top