Email Auto-Filtering
I would like to use th开发者_如何学Goe masked edit box to let people type in input a valid email address, What is the best mask i should use in MaskedEditExtender.Mask ?
There are two different things: the mask and the validation.
Obviously, you cannot use one of the predefined MaskTypes (number, date,...) and neither a mask with a fixed length (and a very long mask with enough underscores for every possible email address will be ugly and confuse the user). My answer would be: don't use a mask.
However, you can still validate the email address setting the ValidationExpression to your favorite email regex (like the one that comes with the Regex validator control). Note that no "perfect" email validation regex exists, but you can warn the user if there are apparent errors.
精彩评论