LinkButton::CausesValidation Property
Gets or sets a value indicating whether validation is performed when the LinkButton control is clicked.
Assembly: System.Web (in System.Web.dll)
[ThemeableAttribute(false)] public: virtual property bool CausesValidation { bool get (); void set (bool value); }
<asp:LinkButton CausesValidation="True|False" />
Property Value
Type: System::Booleantrue if validation is performed when the LinkButton control is clicked; otherwise, false. The default value is true.
Implements
IButtonControl::CausesValidationBy default, page validation is performed when a LinkButton control is clicked. 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.
You can specify (or determine) whether validation is performed on both the client and the server when a LinkButton control is clicked by using the CausesValidation property. To prevent validation from being performed, set the CausesValidation property to false.
This property is commonly set to false for a Reset or Clear button to prevent validation from being performed when the button is clicked.
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 LinkButton control causes validation.
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.
The following example demonstrates how to use the CausesValidation property to prevent page validation from occurring. Notice how the Validate method activates each validation control independently.
Security Note: |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note: