RegularExpression Date Validation

Ranjeet_8
Posted by Ranjeet_8 under Regular Expressions category on | Points: 40 | Views : 1685
<asp:TextBox ID="txt_Date" runat="server" Style="width: 100px;"   MaxLength="10"></asp:TextBox> 

<asp:RegularExpressionValidator ID="REV_txt_Date" runat="server"
ControlToValidate="txt_Date" ErrorMessage="Enter valid Date!"
ValidationExpression="^((0[1-9]|[1-2][0-9]|3[0-1])[/-](0[1-9]|(10|11|12)))[/-][0-9]{4}$"
SetFocusOnError="True" ></asp:RegularExpressionValidator><br />eg:(DD/MM/YYYY)

Comments or Responses

Login to post response