简单教程
提交运行
代码编辑器:
<!DOCTYPE html> <meta charset="utf-8" /> <form runat="server"> Enter a date between 2005-01-01 and 2005-12-31: <br> <asp:TextBox id="tbox1" runat="server" /> <br><br> <asp:Button Text="Submit" runat="server" /> <br><br> <asp:RangeValidator ControlToValidate="tbox1" MinimumValue="2005-01-01" MaximumValue="2005-12-31" Type="Date" EnableClientScript="false" Text="The date must be between 2005-01-01 and 2005-12-31!" runat="server" /> </form>
运行结果: