[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1543
  • Last Modified:

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

0
weimha
Asked:
weimha
  • 6
  • 5
1 Solution
 
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
 
CodeCruiserCommented:
Try changing it to String instead of removing it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
CodeCruiserCommented:
Then its the limitation of the control that it does not handle the extra characters within the numbers field.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now