在这个代码块中有多少个字段被验证

在这个代码块中有多少个字段被验证

本文介绍了在这个代码块中有多少个字段被验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<form id="form1" runat="server">
            <h1>401K Future Value Calculator</h1>
            <label>Monthly investment:</label>
            <asp:DropDownList ID="ddlMonthlyInvestment" runat="server" CssClass="entry"><br />
            <label>Annual interest rate:</label>
            <asp:TextBox ID="txtInterestRate" runat="server" CssClass="entry">6.0
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    CssClass="validator" ErrorMessage="Interest rate is required." 
                    ControlToValidate="txtInterestRate" Display="Dynamic" Enabled="False">
                <asp:RangeValidator ID="RangeValidator1" runat="server" CssClass="validator" 
                    ControlToValidate="txtInterestRate" Display="Dynamic" 
                    ErrorMessage="Interest rate must range from 1 to 20." MaximumValue="20" 
                    MinimumValue="1" Type="Double" Enabled="False"><br />
            <label>Number of years:</label>
            <asp:TextBox ID="txtYears" runat="server" CssClass="entry">10
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    CssClass="validator" ControlToValidate="txtYears" Display="Dynamic" 
                    ErrorMessage="Number of years is required.">
                <asp:RangeValidator ID="RangeValidator2" runat="server" CssClass="validator"
                    ControlToValidate="txtYears" Display="Dynamic" 
                    ErrorMessage="Years must range from 1 to 45." MaximumValue="45" 
                    MinimumValue="1" Type="Integer" Enabled="False"><br />
            <label>Future value:</label>
            <asp:Label ID="lblFutureValue" runat="server" Text=""><br />
            <asp:Button ID="btnCalculate" runat="server" Text="Calculate" CssClass="button" />
            <asp:Button ID="btnClear" runat="server" Text="Clear" CssClass="button" CausesValidation="False" />
        </form>

推荐答案


这篇关于在这个代码块中有多少个字段被验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 12:24