I have a wizard on my page, and it has a "Next" button. I would like to "click" that button from code-behind when clicking another button on the page.
More specifically: There is a button on my page that has two functions: after clicking it, in the postback, it either sets up the code required to reload the page and display a popup, or it advances the wizard if it deems the popup unnecessary. In case the popup is shown, it contains a button to advance the wizard.
Some code snippets:
Wizard init:
<asp:Wizard ID="RegistrationWizard" meta:resourcekey="RegistrationWizard"
runat="server" OnFinishButtonClick="RegistrationWizard_FinishButtonClick"
OnActiveStepChanged="RegistrationWizard_ActiveStepChanged"
OnNextButtonClick="RegistrationWizard_NextButtonClick">
Button to show popup or advance:
<asp:Button ID="btnModulesNextPostBack" runat="server" CssClass="submit rounded"
meta:resourcekey="btnNext" onclick="btnModulesNextPostBack_Click" />
Button to advance wizard:
<asp:Button ID="btnModulesStepNext" runat="server" CssClass="submit rounded"
meta:resourcekey="btnNext" CommandName="MoveNext" />
Code-behind of the btnModulesNextPostBack_Click method:
protected void btnModulesNextPostBack_Click(object sender, EventArgs e)
{
showPopup = false; // if set to true: will open popup in postback
// ... code to determine if popup should be shown
if (!showNewsletterPopup)
{
// TODO! trigger "move to next step in wizard"
}
}
I don't know what to place in the TODO line, because I want to be sure that all other methods related to the wizard get called in the same order as usual too (RegistrationWizard_NextButtonClick and RegistrationWizard_ActiveStepChanged and maybe others the wizard code calls internally).
How can I do this? (.net version is 4.0)