Custom Date Format Validation

A

Andy

I wish to validate the date a user has entered against the format dd
mmm yyyy

Using the CompareValidator and DataTypeCheck does not work and I
suspect that a Regular Expression is over-engineering. Does anybody
have a simple solution please?

Many thanks in advance.
 
A

Ashish M Bhonkiya

Hi Andy,

when you are using the compare validator to compare to dates it uses the
default culture info of your machine. so the simplest solution is to set the
following line in your web.config with culture which has the dateformat " dd
mmm yyyy".

<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="en-GB" />

HTH
Regards
Ashish M Bhonkiya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top