Link to home
Start Free TrialLog in
Avatar of weimha
weimhaFlag for United States of America

asked on

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

Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

I think you have set the masktype to number but () are not numbers so that could be a problem. Try changing the masktype.
Avatar of weimha

ASKER

When I remove the masktype I get the following:
 
(735) 551-287_
in stead of (573) 555-1287.  
Try changing it to String instead of removing it.
Avatar of weimha

ASKER

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.
What are the options in the dropdown?
Avatar of weimha

ASKER

Date
DateTime
None
Number
Time
Try with none then. I can think of anything else. If none does not help then its down to the control itself.
Avatar of weimha

ASKER

None doesn't work either.
Then its down to the control itself. If you remove the (), does it work. If not then remove - as well and try.
Avatar of weimha

ASKER

I removed the () and now it works.  
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial