aspnet-devexpress-dot-web-dot-aspxtreeview-a57d0840.md
Gets or sets a value that specifies whether server-side processing is required for specific predefined user actions.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(false)]
public bool AutoPostBack { get; set; }
<DefaultValue(False)>
Public Property AutoPostBack As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true, if server-side processing is required, otherwise, false.
|
Use the AutoPostBack property to control whether a predefined user action (such as a click on the node, for instance) can be completely processed on the client side by handling an appropriate client-side event (such as the ASPxClientTreeView.NodeClick in this instance) or a round trip to the server is required, so that the action is finally processed on the server side with the help of the corresponding server-side event (such as the ASPxTreeView.NodeClick event).
Note that the available client-side events whose handlers are assigned in an ASPxTreeView control are always fired regardless of the AutoPostBack property’s setting. The AutoPostBack property’s value only affects the default value of the processOnServer property which is passed to the ASPxTreeView’s specific client-side events. If the AutoPostBack property is set to true, the end-user action is first processed via the corresponding client-side event, and the server-side processing is subsequently performed, if it has not been canceled by the client-side event’s processOnServer property setting. If the value of the AutoPostBack property is false, a specific user action which has a corresponding server-side event can still be processed on the server side, by setting the processOnServer property to true in the client event’s handler.
Note
If the AutoPostBack property is set to false the ASPxTreeView’s behavior is based upon the ASPxTreeView.EnableCallBacks property setting.
Note that server-side events which correspond to specific performed user actions may not be generated in the following two cases:
true, but the corresponding client-side event is handled so that the processOnServer property is set to false.false and the corresponding client-side event is not handled, or handled so that the processOnServer property is not changed (is not set to true).The code below demonstrates how you can change the AutoPostBack and EnableCallBacks options values.
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) {
ASPxTreeView1.AutoPostBack = CheckBox1.Checked;
}
protected void CheckBox2_CheckedChanged(object sender, EventArgs e) {
ASPxTreeView1.EnableCallBacks = CheckBox2.Checked;
}
<dx:ASPxTreeView ID="ASPxTreeView1" runat="server" DataSourceID="XmlDataSource1">
</dx:ASPxTreeView>
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" Text="AutoPostBack" />
<asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox2_CheckedChanged" Text="EnableCallBacks" />
See Also