System.Web.UI.WebControls Namespace TextBox Class
Sets or retrieves a value indicating whether an automatic postback to the server will occur whenever the user changes the content of the text box.
Inline |
<asp:textbox autopostback [ = true | false ] ... > |
Script |
TextBox.AutoPostBack [ = true | false ] |
This property accepts or returns only a boolean value: true if an automatic postback to the server will occur whenever the user changes the text in the text box; otherwise false. Default value is false.
Use the AutoPostBack property to specify whether an automatic postback to the server will occur whenever the user changes the content of the text box.
Note that setting this property to true causes a round trip to the server every time the textbox content is changed. Postback occurs when the user presses the ENTER key or when the text box loses focus after the contents are changed.
IMPORTANT: AutoPostBack requires that the user's browser be set to allow scripting. While this is the default in most cases, some users may have scripting disabled for security reasons.
The following example demonstrates using AutoPostBack in conjunction with the TextChanged event.
<asp:textbox id = "strSearch" runat = "server" autopostback
onTextChanged = "getItems" enableviewstate=false />
Show me
TextBox Members