ComponentOne Input for ASP.NET WebForms
Task-Based Help / C1InputMask Tasks / Creating a Phone Number Mask
In This Topic
    Creating a Phone Number Mask
    In This Topic

    The following example demonstrates using enumeration parts in the MaskFormat property. This example uses the C1InputMask 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 C1InputMask 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:

    To write code in Source View

    <cc1:C1InputMask ID="C1InputMask1" runat="server" 
    Mask="(999) 000-0000"
    Text="412"
    </cc1:C1InputMask>

    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: