ComponentOne Input for ASP.NET AJAX: Input for ASP.NET AJAX Task-Based Help > C1MaskedInput Tasks > Creating an IP Address Mask

Creating an IP Address Mask

The following example demonstrates how to use numeric ranges to represent a masked text box for editing an IP address. This example uses the C1MaskedInput control with the custom mask: <<0…255>>\.<<0…255>>\.<<0…255>>\.<<0…255>>.

To create an IP address mask using the Tasks menu:

To display the IP address value with specific text, 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.   Enter the following mask in the Mask text box: <<0...255>>\.<<0...255>>\.<<0...255>>\.<<0...255>>

 

 

Note that the Designer automatically switches to <Custom> when you start typing the mask (if the typed mask is not found in list of masks).

3.   Click OK.

4.   With the Tasks menu still open, enter 192168001001 in the Text text box.

To create an IP address mask using .html markup:

To create the masked value for an IP address, use the following markup in the .aspx page:

 

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

Mask="<<0...255>>\.<<0...255>>\.<<0...255>>\.<<0...255>>"

Text="192168001001">

</cc1:C1MaskedInput>

Note: One character "<" or ">" forces the next characters to shift down or shift up instructions. Character "." without "\" acts as a decimal placeholder and actual display characters used will be the decimal placeholder appropriate to the value of the Culture property.

This topic illustrates the following:

Run the project and notice that the IP address mask with the 192168001001 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.