Phone number displayed incorrectly in ajax control instrumentation masks?
I have a phone number 866-234-5678.
I have an asp textbox and I am applying the following mask:
<cc2:MaskedEditExtender ID="maskPhone"
runat="server"
ClearMaskOnLostFocus="false"
AutoComplete="false"
MaskType="None"
Mask="(999)-999-9999"
InputDirection="LeftToRight"
TargetControlID="txtPhone">
</cc2:MaskedEditExtender>
When I load a page with a text box, the phone number is displayed like this:
(662) -345-678 _
a source to share
When you set the .Text property to page_load, the code behind is set to rendered <INPUT
and then Mask Applied with Javascript after the page finishes rendering in the browser. Since the first character ( 8
) is not part of the mask as that point, the javascript for the expander seems to overwrite it with the first brace of the (
mask. This is strange behavior, but completely reproducible.
If you change your code to
tbxPhone.Text = " 8662345678";
Seems to fix this since the filled space is the one that's truncated, but this one is damn ugly. It's probably best to register a ticket with the developers on CodePlex, or take a hit at fixing the expander yourself if you feel it :)
a source to share