ComponentOne Input for ASP.NET AJAX: Input for ASP.NET AJAX Task-Based Help > C1MaskedInput Tasks > Creating a Phone Number Mask

Creating a Phone Number Mask

The following example demonstrates using enumeration parts in the Mask property. This example uses the C1MaskedInput control with the Phone Number mask: (999) 000-0000.

To create a phone number mask using the Tasks menu:

To display the Phone Number value with a 412 area code, complete the following tasks:

1.   Open the C1MaskedInput Tasks menu and click the Mask property's ellipsis button to open the Input Mask dialog box.

2.   Choose Phone number for the mask value and click OK.

3.   With the Tasks menu still open, type 412 in the Text text box.

 

To create a phone number mask using .html markup:

To display the Phone Number value with a 412 area code, use the following markup in the .aspx page:

 

<cc1:C1MaskedInput ID="C1MaskedInput1" runat="server"

Mask="(999) 000-0000"

Text="412"

</cc1:C1MaskedInput>

Note: Character "9" acts as a masking element: digit or space, optional. Character "0" acts as a masking element: digit, required. This masking element will accept any single digit between 0 and 9.

This topic illustrates the following:

Run the project and notice that the Phone Number mask with the 412 text is displayed in the Web browser, as shown here:

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.