Validate Date in dd/MM/yyyy format

Sometime we need to validate our control for proper date format in dd/MM/yyyy format. Below is the code snippet for that. Main part of code snippet is the Regular expression i used to validate.

<asp:TextBox ID=”txtDate” runat=”server”></asp:TextBox>

<asp:RegularExpressionValidator ID=”revDTTest” runat=”server” ControlToValidate=”txtDate” ForeColor=”Red”
ErrorMessage=”Enter Valid Date in dd/mm/yyyy format.” SetFocusOnError=”True” Display=”Dynamic”


3 thoughts on “Validate Date in dd/MM/yyyy format

Leave a Comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s