Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using ASP.Net Wizard control for my application. the wizard steps are not fixed, they depend on some criteria. so I want to create dynamic wizard based on the criteria.

Can anybody help me to create dynamic wizard control, and dynamic textboxes with requiredfield validators in that wizard?

Thanks
Posted

1 solution

hi
Have container in your page as <div id="wizard_container" runat="server"></div>

Then from the Page_Init event create and add the wizard.
C#
protected void Page_Init(object sender, EventArgs e)
{

    Wizard wizard1 = new Wizard();
    TextBox text1 = new TextBox();
    WizardStep step1 = new WizardStep();
    step1.Controls.Add(text1);
    step1.ID = "step3";
    step1.Title = "Step 3";


    TextBox text2 = new TextBox();
    WizardStep step2 = new WizardStep();
    step2.Controls.Add(text2);
    step2.ID = "step4";
    step2.Title = "Step 4";

    wizard1.WizardSteps.Add(step1);
    wizard1.WizardSteps.Add(step2);

    wizard_container.Controls.Add(wizard1);


}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900