Click here to Skip to main content
15,898,999 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have used this codes but its not working?



XML
<asp:TextBox ID="txtPhoneNumber" runat="server"></asp:TextBox>
<asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtPhoneNumber"
MaskType="Number" Mask="999-999-9999" MessageValidatorTip="true">
</asp:MaskedEditExtender>
Posted

1 solution

If your ASPX page is throwing exception, please check whether ScriptManager instance is added in your page or Master Page which you might be using. ScriptManager should be added after form tag in ASPX/Master page.

Once ScriptManager is present, MasterEditExtender should work, and by looking at the HTML you have provided, it will not display the mask characters and format once the data is entered. To retain the masking please set the ClearMaskOnLostFocus property for MaskedEditExtender. So the resultant HTML will be like this

XML
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtPhoneNumber"
            MaskType="Number" Mask="999-999-9999" MessageValidatorTip="true"
            ClearMaskOnLostFocus="False" >
        </ajaxToolkit:MaskedEditExtender>


Hope that helps,
Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900