ComponentOne Input for ASP.NET AJAX: Using C1MaskedInput

Using C1MaskedInput

The C1MaskedInput control is basically an enhanced TextBox control that uses a mask to distinguish between proper and improper user input. It is the main Web control used for entering and editing information of any data type in a text form. C1MaskedInput serves as a base class for the C1DateInput and C1NumericInput controls. The following image shows a C1MaskedInput control with a phone number Mask.

 

 

Using the Mask property, you can specify the following input without writing any custom validation logic in your application:

      Mask literals (characters that should appear directly in the C1MaskedInput control); for example, the hyphen (-) in a phone number.

      The type of input required at a given position in the mask; for example, numeric or alphabetic.

      Custom input characters.

Key Benefits

The key benefits of C1MaskedInput include the following:

      It's easy to master C1MaskedInput because its most basic properties and methods are similar in behavior with the System.Windows.Forms.MaskedTextBox control at the input of text. The C1MaskedInput properties and methods are distinctive with additional functionality.

      Ability to copy and paste to and from Input for ASP.NET AJAX controls.

      Keyboard support:

LEFT/RIGHT ARROWS: move the cursor one position to the left/right.

HOME/END: move the cursor to the beginning or end.

UP/DOWN ARROWS: for enumerations and numeric ranges, increase or decrease  the enumeration/numeric range value.

DELETE/BACKSPACE: for enumeration/numeric range, set value of enumeration/numeric range to initial value.

CTRL+C and CTRL+V: support for copy/paste keyboard shortcuts.

      Ability to choose a specific culture for C1MaskedInput, for example, English, Spanish, German, Russian, and so on.

      Ability to change most properties of C1MaskedInput "on-the-fly" from client script.

      Client-side events available for you to use to increase the performance of your Web form by eliminating a postback.


Defining C1MaskedInput

Using Password Characters


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