.netajaxmaskededitextender

AJAX MaskedEditExtender for phone numbers


I've read through the Masked Edit and Phone Number control at asp.net and browsed for a while on this subject but haven't found an answer as to why this behavior is occurring.
I have the following MaskedEditExtender defined for use with phone numbers. I would like the mask to display prior to entering information into the textbox and remain both while making the entry and also after a valid entry.

<ajax:MaskedEditExtender ID="mee1" runat="server" Mask="999-999-9999" 
 AcceptNegative="None" MessageValidatorTip="true" TargetControlID="tbBox"
 MaskType="Number" ClearMaskOnLostFocus="false" ClearTextOnInvalid="false">

I believed a simple definition like the above would work, but the behavior of the form is erratic. The mask is visible prior to entering a value (when the textbox is empty) but while entering the mask disappears. Also, after the entry is made, the mask is no longer visible unless I click out of the textbox and then back into it. Once I get the mask to reappear with the entry, it seems to remain.

Is this control broken or am I missing something basic?

Thanks much for any help!


Solution

  • I hope this helps someone else. This issue was caused by a single statement in a PreRender method.

    tbBox.MaxLength = <some integer>;
    

    Apparently by changing this simple value as a property of the textbox caused all sorts of strangeness.
    If anyone has an idea of why this is causing the failure I'd love to hear it. Thanks!