TextBox::AutoPostBack Property
Gets or sets a value that indicates whether an automatic postback to the server occurs when the TextBox control loses focus.
Assembly: System.Web (in System.Web.dll)
[ThemeableAttribute(false)] public: virtual property bool AutoPostBack { bool get (); void set (bool value); }
<asp:TextBox AutoPostBack="True|False" />
Property Value
Type: System::Booleantrue if an automatic postback occurs when the TextBox control loses focus; otherwise, false. The default is false.
Use the AutoPostBack property to specify whether an automatic postback to the server will occur when the TextBox control loses focus. Pressing the ENTER or the TAB key while in the TextBox control is the most common way to change focus.
Note: |
|---|
If the TextBox control's parent container contains a button marked as the default button (for example, if the container's DefaultButton or DefaultButton property is set), the default button's Click event is not raised in response to the automatic postback. |
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.
| Topic | Location |
|---|---|
| How to: Respond to Changes in a TextBox Web Server Control | Building ASP .NET Web Applications |
| How to: Specify Whether ASP.NET Web Server Controls Post to the Server | Building ASP .NET Web Applications |
| How to: Respond to Changes in a TextBox Web Server Control | Building ASP .NET Web Applications |
| How to: Specify Whether ASP.NET Web Server Controls Post to the Server | Building ASP .NET Web Applications |
The following example shows how to use the AutoPostBack property to automatically display the sum of the values entered in the text boxes when the TextBox control loses focus.
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.
Note: