Ticket Q348532
Visible to All Users

ASPxPageControl - How to improve the TabPages loading speed

created 13 years ago

Please consider this scenario: page with one ASPxPageControl with several TabPages each with one or more ASPxGridViews (bound to several LinqDataSources).
I want everytime a TabPage is clicked to refresh all its content, i.e. only that TabPage’s GridViews get refreshed, so I am using ASPxPageControl in callback mode and also reloadContentOnCallback = true.
However on each callback all LinqDataSources for all Gridviews get refreshed sending unnecessary queries to the database, consuming too much time on a complex page like this.
I realize that ASP.NET mandates that all controls be reconstructed in callbacks, but does that necessary mean that all “invisible” controls need to get their datasources refreshed ?
Do you have any suggestion on how to implement this kind of functionality?

Show previous comments (17)
DevExpress Support Team 13 years ago

    Pedro,
    Please pardon me, but I am a bit stuck on your project. Could you please clarify what should I do with the application to reproduce the issue with an empty tab?
    Do I need to add a new tab and then check that the TabIndex is changed properly?
    Thanks,
    Vest

      Vest, no problem, I just attached another version of the project with 2 "default" pages.
          - Default.aspx works fine with my hack.
          - DefaultNW.aspx does not.
      To confirm pleace breakpoints in *_Selecting functions of both pages.
      As I understand the problem is that in DefaultNW the ActiveTabChanged event is not called for the "inicial" TabPage (the one specified in the propertie ActiveTabIndex - try changing it).
      Best regards, and please excuse my english…
      Pedro

      DevExpress Support Team 13 years ago

        Pedro,
        Thank you for the updated project. I will examine it soon.
        Please excuse me for any possible delay.
        Thanks,
        Vest

        Answers approved by DevExpress Support

        created 13 years ago (modified 12 years ago)

        Pedro,
        I have examined the application and found out that you faced the ASP.NET Page Life cycle issue:
        When a page is rendered for the first time, the current tab index is 2. The page control preserves this value and it is always set to this value before the control initialization. When you switch the control to a different page, the control does not update its ViewState (because of callbacks), and thus the server always preserves the "2" index. However, when you open the third page again, the server sees that the initial value is still 2, a user opens the third page (the index is 2, again), and thus it does not see a difference. That is why the "changing" event is not raised.
        I have slightly modified your application to make it work. Please take a look at the attachment.
        Thanks,
        Vest

          Comments (3)

            Hi Vest,
            Sorry for the late reply.
            Thank you very much for your example everything works fine now.
            Although i cannot use it becaus a session variable is not suitable for usage with more than one opened copies of the same page, i will try to adapt it.
            Best regards,

            DevExpress Support Team 13 years ago

              Hello Pedro,
              It is not necessary to use Session. You are free to use ASPxHiddenField and work with it using client-side code and the ASPxPageControl.JSProperties property, or you can use a standard hidden field, and read its values using Request.Params.
              Thanks,
              Vest

                Thanks. Closing this question.

                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.