The C1InputMask 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. C1InputMask serves as a base class for the C1InputDate and C1InputNumeric controls. The following image shows a C1InputMask 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 C1InputMask 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 C1InputMask include the following:
- It's easy to master C1InputMask because its most basic properties and methods are similar in behavior with the System.Windows.Forms.MaskedTextBox control at the input of text. The C1InputMask properties and methods are distinctive with additional functionality.
- Ability to copy and paste to and from Input for ASP.NET Web Forms 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 C1InputMask, for example, English, Spanish, German, Russian, and so on.
- Ability to change most properties of C1InputMask "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.
See Also