Search code examples
c#.netasp.netajaxmaskededitextender

AjaxToolkit.MaskedEditExtender doesn't accept mask


overnight the ASP.NET AJAX extender MaskedEdit stopped working.

<asp:MaskedEditExtender ID="dateTB_Maskedextender" runat="server" 
    MaskType="Date" Mask="9999/99/99" TargetControlID="dateTB" />

That's my Markup code, pretty straight forward, but when you input a date in the textbox (eg. 2011.08.16) and change controlfocus the last two digits (day) magically turn to zeroes (eg. 2011.08.00). Seeing as the mask="99/99/9999" somehow works I'm not doomed, but I'd very much prefer to keep it yyyy.MM.dd as it's the more logically sound dateformat..

Any information/theories on why it might've stopped working and how to fix it would be apritiated

EDIT2*
Added textbox markup

<asp:TextBox ID="dateTB" runat="server" />

Solution

  • For MaskeditExtender Mask is dependent on cultureName and by default it is en-US and for that default mask supported is 99/99/9999.

    so add CultureName="sv-SE" then it will support to Mask="9999/99/99"

    Thanks, Arun