Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: MaskEditValidator does not work with date input using format dd/mm/yyyy [23236]

$
0
0
MaskEditValidator does not validate correctly if the date format is dd/mm/yyyy.
Attached is the fix for the bug.

In the following file AjaxControlToolkitSource\AjaxControlToolkit\MaskedEdit\MaskedEditValidator.cs at Line 590 I added the below line of code.
ControlCulture = System.Globalization.CultureInfo.GetCultureInfo(Culture);

Below is a sample code snippet that now works after the fix.

<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="dtpDate" runat="server" Format="dd/MM/yyyy" TargetControlID="txtDate" />
<ajaxToolkit:MaskedEditExtender ID="mskDate" runat="server" TargetControlID="txtDate"
MaskType="Date" Mask="99/99/9999" CultureName="en-GB" CultureDateFormat="DMY" OnInvalidCssClass="field_error"/>
<ajaxToolkit:MaskedEditValidator ID="mevDate" runat="server"
ControlExtender="mskDate"
ControlToValidate="txtDate"
InvalidValueMessage="Date is invalid. Format is dd/mm/yyyy."
Display="None"
ValidationGroup="CaptureFields" /> dd/mm/yyyy
Comments: how to attache above mentioned file in the our project.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>