How to access Next button in createuserwizard

Last post 08-24-2007 1:17 PM by tamizhppiriyan. 2 replies.

Sort Posts:

  • How to access Next button in createuserwizard

    08-22-2007, 6:45 PM

    Hi,

     I have a createuserwizard with 2 steps. The first step is basic user validation, second step is creating the user.

    I want to show/hide the Next Button in the first step. How to acheive this. I have searched all over and many have posted similar problem,but no solution...

    your help is greatly appreciated.

    Thanks,

    http://dotnet-tips.blogspot.com/
  • Re: How to access Next button in createuserwizard

    08-24-2007, 4:34 AM
    Answer

    Hi,

    If you want to access the next button in the winzard, you should use convert the winzard to the StepNavigationTemplate. In this StepNavigationTemplate, you can see there are two buttons, Previous and Next.

    For example:

     <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" OnFinishButtonClick="Wizard1_FinishButtonClick" OnNextButtonClick="Wizard1_NextButtonClick">
                            <WizardSteps>
                                <asp:WizardStep ID="Step1" runat="server" Title="Step 1">
                                <asp:Label ID="lbl1" Text="Step1" runat=server></asp:Label>
                                </asp:WizardStep>
                                <asp:WizardStep ID="Step2" runat="server" Title="Step 2">
                                <asp:Label ID="lbl2" Text="Step2" runat=server></asp:Label>
                                </asp:WizardStep>
                                <asp:WizardStep ID="Step3" runat="server" Title="Step3">
                                <asp:Label ID="lbl3" Text="Step3" runat=server></asp:Label>
                                </asp:WizardStep>
                                <asp:WizardStep ID="Step4" runat="server" Title="Step4">
                                <asp:Label ID="lbl4" Text="Step4" runat=server></asp:Label>
                                </asp:WizardStep>
                            </WizardSteps>
                            <StepNavigationTemplate>
                                <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" />
                                <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next" />
                            </StepNavigationTemplate>
                        </asp:Wizard>
     So you  can access them in the page's codebehind.

    For example(the winzard control is on the master page):

     Button btn = (Button)this.Page.FindControl("ctl00$Wizard1$StepNavigationTemplateContainerID$StepPreviousButton");
           btn.Visible = false;
     Hope it helps.
    Amanda Wang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: How to access Next button in createuserwizard

    08-24-2007, 1:17 PM

    Thanks a lot, That works. But its surprising there is no easier way to get hold of the control except to use the clientID.

    Thanks for your time.

    http://dotnet-tips.blogspot.com/
Page 1 of 1 (3 items)