Code-behind:
public partial class WebForm1 : System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
var t = new TemplatedWizardStep { Title = "Lalalal" };
t.Controls.Add(new Step1UserControl());
_WizardWebControl.WizardSteps.Add(t);
base.OnInit(e);
}
}
Page markup:
<asp:Wizard runat="server" id="_WizardWebControl">
Step1UserControl.ascx markup:
<fieldset>
<legend>General Informations</legend>
<p>TEST DYNAMIC</p>
</fieldset>
The step show at the left bar with the Title, but the HTML (fieldset and the paragraph) is not displayed in the step. It requires to be a TemplatedWizardStep too because we use Template for the layout. How do I add a Step dynamically?