Edit Mask Extender for phone number hiding first character

I have a edit mast extender that should display a phone number like (573) 111-5555 but instead it shows (_73) 111-5555.  

My code is shown below.  What's wrong with it.

(I need to continue to show the edit mask even when not it that field).
<asp:TextBox ID="txtNumber" runat="server"></asp:TextBox><cc1:MaskedEditExtender ID="txtNumber_MaskedEditExtender" runat="server" 
                            Enabled="True" Mask="(999) 999-9999" TargetControlID="txtNumber" ClearMaskOnLostFocus="False" MaskType="Number" ErrorTooltipEnabled="True" AutoComplete="False">
                        </cc1:MaskedEditExtender>

Open in new window

weimhaAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
Then its the limitation of the control that it does not handle the extra characters within the numbers field.
0
 
CodeCruiserCommented:
I think you have set the masktype to number but () are not numbers so that could be a problem. Try changing the masktype.
0
 
weimhaAuthor Commented:
When I remove the masktype I get the following:
 
(735) 551-287_
in stead of (573) 555-1287.  
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CodeCruiserCommented:
Try changing it to String instead of removing it.
0
 
weimhaAuthor Commented:
String (or string) as the masktype gives me the following runtime error:
Parser Error Message: Cannot create an object of type 'AjaxControlToolkit.MaskedEditType' from its string representation 'string' for the 'MaskType' property.
 
String is also not an option from the drop down list so I had to type it in.
0
 
CodeCruiserCommented:
What are the options in the dropdown?
0
 
weimhaAuthor Commented:
Date
DateTime
None
Number
Time
0
 
CodeCruiserCommented:
Try with none then. I can think of anything else. If none does not help then its down to the control itself.
0
 
weimhaAuthor Commented:
None doesn't work either.
0
 
CodeCruiserCommented:
Then its down to the control itself. If you remove the (), does it work. If not then remove - as well and try.
0
 
weimhaAuthor Commented:
I removed the () and now it works.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.