Monday, August 17, 2009

Accept dd/mm/yyyy date format in ASP.NET AJAX MaskedEditExtender

A simple way to use the dd/mm/yyyy date format in the ASP.NET AJAX MaskedEditExtender is to use a culturename in the extender that supports this format. Shown below is an example which accepts the date in dd/mm/yyyy format and also use a MaskedEditValidator for a date field. The CultureName used here is of Great Britain "en-GB"









CultureName="en-GB" TargetControlID="txtDate"

Mask="99/99/9999" MaskType="Date" AcceptNegative="None"/>


ControlExtender="MaskedEditExtender1"

EmptyValueMessage="Please enter Date" InvalidValueMessage="Invalid Date"

ControlToValidate="txtDate" ValidationGroup="DtVal" />

No comments:

Post a Comment