0

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" />
Emyr
  • 2,351
  • 18
  • 38
Enror
  • 565
  • 1
  • 4
  • 8

1 Answers1

0

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

Arun Rana
  • 8,426
  • 14
  • 67
  • 107
  • Thanks that works fine, I managed to get to that solution myself after a (dozen) cups of coffee but I'm still curious on how it could instantly stop working with the previous setup... No win update has taken place between working and notworking... It's puzzling – Enror Aug 16 '11 at 09:43
  • I could not get your point of previous setup , can you explain it in details so i can help you?. – Arun Rana Aug 17 '11 at 05:36
  • Was abit delerious yesterday, let's see if I can be clearer today. In a couple of projects I've been working on I've been using the mask 9999/99/99 without any form of culture settings than the MaskedEditExtenders default and it was working fine... Until yesterday, so what I'm acctually curious about is how it could stop working just like that without any apparent changes to my source/VS2010/windows/the devIS.. I prefered my previous setup due to it's more aestethic feel. But seeing as my current solution has almost the same layout I'm not going to dwell on this much longer – Enror Aug 17 '11 at 07:02
  • your statements contradicts in this way.. You told that you have not made any changes VS2010 and in second line you told that i like my previous setup so what exactly you have made in your system? I guess it should be system setting preference problem because culture info dependent on that.. – Arun Rana Aug 17 '11 at 08:09
  • My previous setup meaning, the 9999/99/99 mask with default culture settings, current setup with the "sv-SE" culture setting defined in the Code. Nothing, and I stress Nothing else has changed... I only changed the maskculture settings because my previous setup stopped working. – Enror Aug 18 '11 at 07:47
  • I got your point but sorry i could not help you in this case also i am curious to know about how it has worked with your previous setup :) – Arun Rana Aug 18 '11 at 08:11