asp.net.ph

BaseValidator.Display Property

System.Web.UI.WebControls Namespace   BaseValidator Class


Sets or retrieves the display behavior of the error message in a validation control.

Syntax


Inline <asp:validator display = strDisplay ... >
Script Validator.Display [ = strDisplay ]

Property Value


strDisplay String specifying one of the ValidatorDisplay enumeration values.

The property is read/write with a default value of Static.

Exceptions


Exception Display Condition
ArgumentException The given value is not one of the ValidatorDisplay values.

Remarks

Use the Display property to specify the display behavior of the error message in the validation control. The following table briefly describes the different values that can be used.

Display Behavior Description
Dynamic Space for the validation message is dynamically added to the page if validation fails.
None The validation message is never displayed inline.
Static Space for the validation message is allocated in the page layout.

The display behavior depends on whether client-side validation is performed. If client-side validation is not active ( because the browser does not support it or because it has been disabled ), Static and Dynamic behave the same way: the error message only takes up space if it is displayed. The ability to dynamically allocate space for the message when it is not being displayed ( Static ) only works with client-side validation.

Example

The following example demonstrates how to use the Display property to programatically set the validation message display mode when validation fails.

 Show me 

See Also

BaseValidator Members   Base Validation Control Properties   Controlling Validation Message Display 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