Visual Studio does not handle correctly the control

S

Seduto

Hi all,
I have build a custom webcontrol. It works fine.
The control has other controls inside.

[ToolboxData("<{0}:Navigation runat=server></{0}:Navigation>")]
[ParseChildren(false)]
public class Navigation: BaseControl, INamingContainer
{


As long as I edit directly the page aspx everything work. When I modified
any proprty of the control from the property edit Visual Studio delete
everything inside the control.

Any idea how to fix this problem?

Thank you.
 
T

Teemu Keiski

Hi,

to clarify, do you allow adding child controls to this one via VS.NET
design interface?

If that's the case I suppose that you should also have PersistChildren(true)
so that designer persists child controls as nested inner controls. Second
thing is that you might want to have some sort of designer for your control
(unless you don't already have). Panel has a PanelDesigner which derives
from ReadWriteControlDesigner (such is needed when adding child controls
into a control via design drag/drop interface like with Panel)
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top