ValidatorDisplay 枚举

定义

指定验证控件中错误信息的显示行为。Specifies the display behavior of error messages in validation controls.

public enum class ValidatorDisplay
public enum ValidatorDisplay
type ValidatorDisplay = 
Public Enum ValidatorDisplay
继承
ValidatorDisplay

字段

Dynamic 2

验证失败时动态添加到页面中的验证程序内容。Validator content dynamically added to the page when validation fails.

None 0

从不内联显示的验证程序内容。Validator content never displayed inline.

Static 1

作为页面布局的物理组成部分的验证程序内容。Validator content physically part of the page layout.

注解

ValidatorDisplay枚举表示验证控件中错误消息的不同显示行为。The ValidatorDisplay enumeration represents the different display behaviors of error messages in validation controls.

None 指定您只想在ValidationSummary控件中显示错误消息。None specifies that you only want to display the error message in a ValidationSummary control. 错误消息将不会显示在验证控件中。The error message will not display in the validation control.

Static 指定当验证程序控件显示错误消息时, 不希望网页的布局发生更改。Static specifies that you don't want the layout of the Web page to change when validator controls display error messages. 显示页面时, 将为错误消息分配页面上的空间。Space on the page is allocated for the error messages when displaying the page. 验证程序的内容是页面的物理部分;因此, 同一输入控件的多个验证程序必须占据页面上的不同位置。The validator contents are physically part of the page; therefore, multiple validators for the same input control must occupy different locations on the page.

动态指定在验证失败时要在网页上动态放置错误消息。Dynamic specifies that you want to dynamically place error messages on the Web page when validation fails. 不会在页面上分配验证内容的空间;因此, 页面会动态更改以显示错误消息。Space for the validation content is not allocated on the page; therefore, the page dynamically changes to display the error message. 这允许多个验证程序在页面上共享同一物理位置。This allows multiple validators to share the same physical location on the page. 为了使页面布局在显示错误消息时保持更改, 必须将包含验证器的 HTML 元素的大小调整为足以容纳最大验证程序大小。In order to keep the page layout from changing when an error message is displayed, the HTML element containing the validator must be sized large enough to accommodate the maximum size of the validator.

可访问性Accessibility

有关如何配置验证控件以便生成符合辅助功能标准的标记的信息, 请参阅Visual Studio 中的辅助功能和 ASP.NETASP.NET 控件和辅助功能For information about how to configure validation controls so that they generate markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

适用于

另请参阅