asp.net.ph

RegularExpressionValidator.ValidationExpression Property

System.Web.UI.WebControls   RegularExpressionValidator Class


Sets or retrieves the regular expression pattern used to validate a field.

Syntax


Inline <asp:regularexpressionvalidator validationexpression = strRegEx ... >
Script RegularExpressionValidator.ValidationExpression = strRegEx

Property Value


strRegEx String specifying the regular expression assigned as the validation criteria.

The property is read/write with no default value.

Exceptions


Exception Type Condition
HttpException The given regular expression is malformed.

Remarks

Use this property to specify the pattern used to check for predictable sequences of characters, such as those in social security numbers, e-mail addresses, telephone numbers, and postal codes.

For syntax, see Regular Expressions Language Elements.

Example

The following example demonstrates how to use the ValidationExpression property to validate a field with five numeric digits.

 Show me 

See Also

RegularExpressionValidator Members   Validating Against Patterns Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph