TextBox.CausesValidation Propriedade

Definição

Obtém ou define um valor que indica se a validação é executada quando o controle TextBox está definido para validar quando ocorrer um postback.Gets or sets a value indicating whether validation is performed when the TextBox control is set to validate when a postback occurs.

public:
 virtual property bool CausesValidation { bool get(); void set(bool value); };
[System.Web.UI.Themeable(false)]
public virtual bool CausesValidation { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.CausesValidation : bool with get, set
Public Overridable Property CausesValidation As Boolean

Valor da propriedade

Boolean

true se a validação for executada quando o controle TextBox estiver configurado para validar quando ocorrer um postback; caso contrário, false.true if validation is performed when the TextBox control is set to validate when a postback occurs; otherwise, false. O valor padrão é false.The default value is false.

Atributos

Comentários

Use a CausesValidation propriedade para determinar se a validação é executada no cliente e no servidor quando um TextBox controle é definido para validar quando ocorre um postback.Use the CausesValidation property to determine whether validation is performed on both the client and the server when a TextBox control is set to validate when a postback occurs. A validação de página determina se os controles de entrada associados a um controle de validação na página todas passam as regras de validação especificadas pelo controle de validação.Page validation determines whether the input controls associated with a validation control on the page all pass the validation rules specified by the validation control.

Por padrão, um TextBox controle não causa validação de página quando o controle perde o foco.By default, a TextBox control does not cause page validation when the control loses focus. Para definir o TextBox controle para validar quando ocorre um postback, defina a CausesValidation propriedade como true e a AutoPostBack propriedade como true .To set the TextBox control to validate when a postback occurs, set the CausesValidation property to true and the AutoPostBack property to true.

Quando o valor da CausesValidation propriedade é definido como true , você também pode usar a ValidationGroup propriedade para especificar o nome do grupo de validação para o qual o TextBox controle causa a validação.When the value of the CausesValidation property is set to true, you can also use the ValidationGroup property to specify the name of the validation group for which the TextBox control causes validation.

Esta propriedade não pode ser definida por temas ou temas de folha de estilo.This property cannot be set by themes or style sheet themes. Para obter mais informações, consulte ThemeableAttribute e temas e capas do ASP.net.For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

Aplica-se a

Confira também