views:

1022

answers:

5

I have the following telephone 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 the textbox, the telephone number displays like the following:

(662)-345-678_

+1  A: 

The mask states 4 digits for the last group. The underscore '_' displayed is the PromptCharacter of the MaskedEditExtender.

edosoft
I know, I am loading the number into the textbox programmitcally. When I load 866-234-5678, it displays as (662)-345-678_ instead of (866)-234-5678.
Xaisoft
A: 

When you set the .Text property in the page_load, code behind, the value of the rendered <INPUT is set, and then the Mask Applied with Javascript after the page finishes rendering in the browser. Because the first character (the 8) isn't part of the mask as that point, the javascript for the extender seems to overwrite it with the first parenthesis ( of the mask. It's an odd behaviour but completely replicable.

If you change your code behind to

tbxPhone.Text = " 8662345678";

This seems to fix it as the padded space is the one that gets truncated but that's damn fugly. Probably best to log a ticket with the devs on CodePlex or take a stab at fixing the extender yourself if you feel up to it :)

Eoin Campbell
A: 
A: 

Just do it !!!!!

wwd
A: 

Just do it !!!!!

wwd