ASP.Net表单向导验证

时间:2013-12-06 15:15:10

标签: asp.net validation

我正在使用ASP.Net表单向导,它有三个步骤。在每个步骤中都有必填字段。在单击“下一步”按钮的步骤1和2中,验证工作。错误消息显示在所需字段旁边。我在步骤3中有几个必填字段,但是当单击“完成”按钮时,它不会验证最后一步中的必填字段。不知道我错过了什么。

我的导演大纲如下:

<asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false" NavigationStyle-CssClass="form_nav_style" FinishCompleteButtonText="Next" OnFinishButtonClick="cmd_UserSession" FinishDestinationPageUrl="~/mypage.aspx" OnNextButtonClick="cmd_PrcntSalesValue" ValidateRequestMode="Enabled">
        <WizardSteps>
            <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
                // required field validator works
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
                // required field validator works
            </asp:WizardStep>
            <asp:WizardStep ID="Step_3" runat="server" StepType="Finish">
                // required field validators are not working and form is submitted
            </asp:WizardStep>
            <asp:WizardStep runat="server" StepType="Complete">

            </asp:WizardStep>
        </WizardSteps>
<StartNextButtonStyle CssClass="btn btn-primary btn-custom-sm" />
        <StepPreviousButtonStyle CssClass="btn btn-inverse btn-custom-sm" />
        <StepNextButtonStyle CssClass="btn btn-primary btn-custom-sm" />
        <FinishPreviousButtonStyle CssClass="btn btn-inverse btn-custom-sm" />
        <FinishCompleteButtonStyle CssClass="btn btn-success btn-custom-sm" />
    </asp:Wizard>

0 个答案:

没有答案