Erik Brink Erik Brink 0 Points 1 Post Save viewstate for inactive tabs over multiple requests

4 posts, 0 answers
  1. Erik
    Erik avatar
    28 posts
    Member since:
    Aug 2010

    Posted 26 Apr 2012 Link to this post

    Hi,

    In my ASP .NET application I use a tabpanel to let the user open multiple subject from a quickbar, like browser tabs but then inside my application. The content of the subjects is dynamically created server-side. To remain the viewstate of inactive tabpages I need to rebuild the content of the inactive tabpages every request again. When the user opens more subject very request to the server will take longer and longer because of this.

    I'm looking for an advanced solution to save the viewstate of inactive tabpages over multiple requests on the active tabpage. When an inactive tabpage becomes active again I want to put the saved viewstate of this tabpage back in the viewstate of the whole page. This can give my application a performance boost when I do not need to rebuild every inactive tabpage on every request to the server.

     
    I have red a lot about the ASP viewstate but I did not found a solution for this yet. Any suggestions how I can accomplish this?

  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 01 May 2012 Link to this post

    Hi Erik,

    When adding content dynamically it should be added to the page controls collection upon every post back, otherwise it will be lost. In the scenario that you are trying to implement only the content of the dynamic tabs should be added to the controls collection of the page. Please refer to the following article here regarding Dynamic Web Server Controls and View State

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Erik
    Erik avatar
    28 posts
    Member since:
    Aug 2010

    Posted 01 May 2012 Link to this post

    Hi Dimitar,

    I know the rules about creating Dynamic content and how to keep the viewstate fore those controls. That works fine for my now, but I want to save memory and gain performance every request by doing it smarter.

    I would like to save the viewstate of an inactive tabpage in the session and put it back in the viewstate of the page when the tabpage becomes active again or something like that.

    Any suggestions how I can accomplish that?
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 03 May 2012 Link to this post

    Hello Erik,

    Please refer to the following article by Scott Hanselman explaining how to save the ViewState into a session variable.

    Greetings,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top