Navigation

Search

Categories

On this page

Date Format Recognition in ASP.NET Controls

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 13
This Year: 0
This Month: 0
This Week: 0
Comments: 0

Sign In
Pick a theme:

# Monday, January 29, 2007
Monday, January 29, 2007 4:53:54 PM UTC ( ASP.Net Controls )

To make an ASP.NET control validator recognize an alternate date format such as DD/MM/YYYY, set the culture at the page level with:

Page.Culture = "en-AU";

This will set the validators for Australian English, and the following validator will work correctly:

<asp:CompareValidator ID="cvStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="The From Date should be in the format DD/MM/YYYY." Operator="DataTypeCheck" Type="Date">*</asp:CompareValidator>