SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 243 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"

MaskType simply
specifies the type of the target validation mask, which can be None, Number, Date, DateTime,
and Time. The Mask property contains the actual mask itself, which can be a combination
of characters, digits, and/or separators, including wildcard characters. Suppose we take
the TextBox from the earlier example and now ask the user to enter a nine-digit social
security number (United States only) following the standard format DDD-DD-DDDD as
shown in the following code snippet:
Please enter your SSN number:  
TargetControlID="TextBox1"
MaskType= "Number"
Mask="999-99-9999"
ClearTextOnInvalid=true />
With that small code segment, the text box now has an input mask guiding the user
through entering the data. The user can only type in nine numbers and nothing else. All
other characters are completely ignored. The mask also helps the user by applying the
appropriate formatting to the entered data. You can see this Figure 8-6.
Figure 8-6.


Pages:
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255