The Wizard is on Step5 and some TextBox validation in Step5 has to be done
on the server so I've been thinking I need to use the OnActiveStepChanged
event. This server-side validation has to be done on the client too but for
now I'm trying to work it out on the server. Interesting to note a simple
return false; on the client keeps Step5 currently active -- but -- this news
article is about doing so on the server.
That is, when the validation test equates as true the Wizard must continue
to display the same step, i.e. Step5 must stay displayed but another step is
always displayed instead; Step6 for example when selecting the Next button.
Using the Previous button to navigate back to Step5 proves the validation
code is functioning because the Wizard1Label.Text property is changed as
expected.
But the damn step won't stay set to Step5 when trying to use the Next button
or when selecting a SideBar DataList item both of which raise the
OnActiveStepChanged event.
What can I do to keep Step5 displayed?
// OnActiveStepChanged event handler
public void OnActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex
==
Wizard1.WizardSteps.IndexOf(this.Step5))
{
// Correctly Displays: 5
Page.Title = Wizard1.ActiveStepIndex.ToString();
if (Step5_EmailTextBox.Text.Length 0
&&
Step5_NameTextBox.Text.Length 0)
{
// Trying ActiveStepIndex won't keep Step5 active
Wizard1.ActiveStepIndex = 5;
// Trying MoveTo moves to other steps but
// won't keep Step5 active either
Wizard1.MoveTo(this.Step5);
Wizard1Label.Text =
"Only one TextBox may contain a data entry.";
}
else
{
Wizard1Label.Text = "-- or --";
}
}
}
I've searched around and haven't found any tips yet. I hope somebody
has some insight on this...
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/