0

我正在尝试设置 StepNavigationTemplate,但它不起作用

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server">
    <StepNavigationTemplate>
        <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Cancel" />
        <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="I Agree" />
    </StepNavigationTemplate>
    <WizardSteps>
        <asp:WizardStep runat="server" Title="Agree to Terms of Use">
        </asp:WizardStep>
    </WizardSteps>
</asp:CreateUserWizard>

它在这里什么都不做,但是当我把它放在里面时<asp:WizardStep>它可以工作,但是它添加了导航按钮,而以前的按钮仍然存在,所以它根本没有用。这个应该怎么用?

4

1 回答 1

0

你的意思是这样的:

<WizardSteps>
<asp:WizardStep runat="server" Title="Your title" ID="wzsStep" StepType="Step"></asp:WizardStep >
.....
</WizardSteps>
<StepNavigationTemplate>

                        <asp:Button ID="uxPreviousStepBtn" Text="Previous" runat="server" CausesValidation="False"
                            Width="80" OnClick="uxPreviousStepBtn_Click" OnPreRender="uxPreviosStepBtn_PreRender" />

                        <asp:Button ID="uxNextStepBtn" Text="Next" runat="server" CausesValidation="True"
                            Width="80" ValidationGroup="MainData" OnClick="uxNextStepBtn_Click" OnPreRender="uxNextStepBtn_PreRender" />


            </StepNavigationTemplate>

protected void uxPreviousStepBtn_Click(object sender, EventArgs e)
{
//Previous step will show
 myWizard.ActiveStepIndex =myWizard.ActiveStepIndex>0? myWizard.ActiveStepIndex-1:0;
}        
protected void uxNextStepBtn_PreRender(object sender, EventArgs e)
    {
    //Check please if next step exists 
          myWizard.ActiveStepIndex =myWizard.ActiveStepIndex+1;
    }
于 2012-11-22T10:18:57.060 回答