asp.net日期控件验证代码

作者:袖梨 2022-06-25

asp教程.net日期控件验证代码

<%@ Page Language=VB Debug=true %>


Comparing a Field to a Date Data Type using the CompareValidator Control





Please enter a Date:

    id="txtDate"
    runat=server
/>
    id="cvCheckDate"
    controltovalidate="txtDate"
    operator="DataTypeCheck"
    type="Date"
    runat="server"
>
    You must enter a date!



    id="butOK"
    text="OK"
    type="Submit"
    runat="server"
/>



           
      
看一个vb.net验证日期代码

<%@ Page Language=VB Debug=true %>



Validating for a Date in the Current Year Using the CustomValidator Control





Enter a date in the current year:

    id="txtDate"
    runat=server
/>
    id="customDate"
    controltovalidate="txtDate"
    onservervalidate="Date_ServerValidation"
    display="Dynamic"
    font-name="Verdana"
    font-bold="True"
    font-size="10pt"
    runat="server">
    You must enter a date in the current year!




    id="butOK"
    text="OK"
    type="Submit"
    onclick="SubmitBtn_Click"
    runat="server"
/>


相关文章

精彩推荐