T
tienleok
Hi,
When using the ASP.NET 2.0 Wizard control, I would like to hide Step 2 when the TextBox in Step 1 has a value of 1. The code below allows me to do that, but after removing Step 2, TextBox values in later steps no longer persist. (EnableViewState has no effect.)
Can anyone enlighten me where my code is going wrong.
Thanks in advance.
Tien Leok
I have the following code in my aspx page:
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" OnLoad="Wizard1_Load">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep3" runat="server" Title="Step 3">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
and the following code in my aspx.cs:
protected void Wizard1_Load(object sender, EventArgs e)
{
if (TextBox1.Text == "1")
Wizard1.WizardSteps.Remove(WizardStep2);
}
When using the ASP.NET 2.0 Wizard control, I would like to hide Step 2 when the TextBox in Step 1 has a value of 1. The code below allows me to do that, but after removing Step 2, TextBox values in later steps no longer persist. (EnableViewState has no effect.)
Can anyone enlighten me where my code is going wrong.
Thanks in advance.
Tien Leok
I have the following code in my aspx page:
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" OnLoad="Wizard1_Load">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep3" runat="server" Title="Step 3">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
and the following code in my aspx.cs:
protected void Wizard1_Load(object sender, EventArgs e)
{
if (TextBox1.Text == "1")
Wizard1.WizardSteps.Remove(WizardStep2);
}