wawang
2/21/2007 3:30:00 AM
Hi Mark,
Yes only the MyTopMostControlDesigner will get called.
To verify this, use following steps:
1) Create a new class library, edit Class1.cs as:
namespace ClassLibrary1
{
[Designer(typeof(Class1Designer))]
public class Class1 : WebControl
{
}
public class Class1Designer : ControlDesigner
{
public Class1Designer()
{
Debugger.Break();
}
public override string GetDesignTimeHtml()
{
return "Class1";
}
}
public class Class2 : CompositeControl
{
private Class1 _c1;
protected override void CreateChildControls()
{
Controls.Clear();
_c1 = new Class1();
Controls.Add(_c1);
}
}
}
2) Configure this class library to launch Visual Studio 2005 (devenv.exe)
when debugged.
3) Start debugging, in the new instance of VS2005, create a new website
4) Add ClassLibrary1.dll from step 1) to the toolbox. It will add Class1
and Class2 to the toolbox.
5) Now drag an instance of Class1 to the designer surface of a webform,
note the first instance of VS2005 IDE will break in Class1Designer's
constructor.
6) Now delete the Class1 instance and drag an instance of Class2 to the
webform, the debugger will not break this time.
Regarding your "GridView as child control" issue, yes I've discussed with
Steven. He's still performing some research to see if there's any
workaround.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.