Hi Allan,
Thanks for the code you mailed to me.
I just realized that the "HeaderContaine r" you're using is actually used to
hold controls in the HeaderTemplate. In this case, dynamic controls added
to it will not work as usual. You will need to create a custom template and
use it as the HeaderTemplate:
public class Class1 : Wizard
{
protected override void CreateChildCont rols()
{
this.HeaderTemp late = new MyTemplate();
base.CreateChil dControls();
}
}
public class MyTemplate : ITemplate
{
public void InstantiateIn(S ystem.Web.UI.Co ntrol container)
{
Button button = new Button();
button.Text = "Hello";
container.Contr ols.Add(button) ;
}
}
This will also works at design-time.
#Creating Web Server Control Templates Dynamically
http://msdn2.microsoft.com/en-us/lib...ak(vs.71).aspx
#Creating Templates Programmaticall y in the DataGrid Control
http://msdn2.microsoft.com/en-us/lib...68(vs.71).aspx
However, please note at this time, user will not be able to use
<HeaderTemplate node in your custom wizard since you completely replaced
it; but I think your objective here is to use a built-in header for your
custom wizard control so I think this should not be an issue.
Hope this helps.
Regards,
Walter Wang (wa****@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.