Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wizard events

Status
Not open for further replies.

kalkumar

Programmer
Jul 7, 2006
40
US
Hi,
I have the wizard control. O n each Wizard step I have put some code next I converted that wizard to templates like the below:
</WizardSteps>
<StepNavigationTemplate>
<asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
Text="< Back" />
<asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next Step >" />
</StepNavigationTemplate>
<StartNavigationTemplate>
<asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" Text="Next Step&gt;" />
</StartNavigationTemplate>
<FinishNavigationTemplate>
<asp:Button ID="FinishPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
Text="&lt; Back" />
<asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" Text="Finish" />
</FinishNavigationTemplate>
</asp:Wizard>

Now I want to write separate code for each button click. For example I want to handle the StepPreviousButton click event. Where to handle that event.
In Wizard_ActiveStepChanged(..){
Here How we check which button is clicked.
Thanks
 
declare a delgate for the Previous/Next Step events and hook up to the wizard.

then place a switch statement in the delegate to handel each step
Code:
protected override OnInit(EventArgs e)
{
   myWizard.NextButtonClickEvent += WixardNavigationEventHandler(MoveNext);
   myWizard.NPreviousButtonClickEvent + WixardNavigationEventHandler(MoveBack);
}

private void MoveNext(object sender, WizardNavigationEventArgs e)
{
}

private void MoveBack(object sender, WizardNavigationEventArgs e)
{
}
this only controls the next/previous actions, not the side bar navigation, cancel or finish actions. for a complete list of events check MDSN for Wizard events.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top