Description:
I am trying to use the ActiveTabChanged event to do some server-side processing. If the EnableCallbacks property is set to true, this event only works the first time I click on the tab. I need the event to fire every time the tab is clicked.
Answer:
The current ASPxPageControl design doesn't allow you to send callbacks on each active page alteration.
Note that the ASPxPageControl's behavior is based upon the combination of AutoPostBack and EnableCallBacks property settings, which can be as follows:
- If the AutoPostBack and EnableCallBacks properties are set to false (the default behavior), the ASPxPageControl works in the so called "client mode". In this mode, the contents of all its pages (active and inactive) are sent to the client during the first response, and active page alteration is performed on the client side without generating any round-trip to the server. In this situation, you can utilize the control's client-side object model (client events and methods) to respond to client-side manipulations.
- If the AutoPostBack property is set to true, the EnableCallBacks property is not in effect, and the ASPxPageControl works in "server mode". In this mode, only the active page's content is sent to the client side during the first response. Then, any change to the active page generates the entire web page's postback, which is processed on the server side (the server ActiveTabChanged event is always generated in this case).
- If the AutoPostBack property is set to false, and the EnableCallBacks property is set to true, the ASPxPageControl functions in the following manner. During the first response, only the active page's content is sent to the client side. When the active page changes, the new active page's content is loaded from the server only once - it is performed dynamically via a callback without refreshing the entire web page. When all pages are loaded to the client in this manner, the ASPxPageControl switches to the "client mode", and further work is performed without generating round-trips to the server. So, the server-side ActiveTabChanged event is called only once for each page in this mode.
Although this behavior is currently considered "by design", there's a suggestion regarding the ability to use callbacks while the ASPxPageControl is in "server mode". You can access and track this suggestion at:
ASPxPageControl - Provide the capability to work through callbacks when the AutoPostBack property is set to true
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.