views:

12

answers:

1

How to reset date Type for Compare Validator in ASP.Net i am using the dd/MM/yyyy format for the Calendar Extender of a textbox, where as Compare Validater looks for MM/dd/YYYY format. so how to change date format of Compare Validator.

+1  A: 

You can change the DateFormat by changing the CultureInfo of the page(or the whole application in the Web.Config). This is possible in the page directive of the aspx-page or in the codebehind. Have a look at MSDN for further information: How to: Set the Culture and UI Culture for ASP.NET Web Page Globalization

For example(MM/dd/YYYY is US-Culture, isnt it?):

<%@ Page UICulture="en-us" Culture="en-US" %>
Tim Schmelter