Sunday, March 11, 2012

CalendarExtender and MaskedEditExtender. Mask edit doesnt support custom date format?:(

Hi Kiros,

I'm a bit confused about why you want your CalendarExtender's Format="dd.MM" and MaskedEditExtender's Mask="99/99" . It is recommended to make them the same format since they are associated to the same control .Otherwise ,there are maybe some conflicts will be occurred.However , you can set the MaskedEditExtender's MaskType = "None" or "Numberic" in your situation. My test shows it will work fine. For example,

 <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100; left: 15px; position: absolute; top: 85px"></asp:TextBox> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" Format="dd.MM"> </ajaxToolkit:CalendarExtender> <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID ="TextBox1" MaskType ="None" Mask ="99/99" InputDirection ="RightToLeft" ClearMaskOnLostFocus="false"> </ajaxToolkit:MaskedEditExtender> <asp:Button ID="Button1" runat="server" Style="z-index: 103; left: 14px; position: absolute; top: 142px" Text="Button" Width="70px" /> </form>

I hope this help.

Best regards,

Jonathan


Hi Jonathan,Yes, I can set MaskType ="None", but then user can typy smth like 54.43:). It is not a right date numerics. May be, It's a good idea to add to MaskType CustomFormat witn Regexps?

Hi Kiros,

In this situation , I suggest that you should add a MaskedEditValidator and set its ValidationExpression property or use additional Javascript to check its validation. Please reference to thispost.

I hope this help.

Best regards,

Jonathan

No comments:

Post a Comment