This is a migrated thread and some comments may be shown as answers.

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

3 Answers 23 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 26 Apr 2012, 04:50 PM

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?

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 01 May 2012, 12:14 PM
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.
0
Erik
Top achievements
Rank 1
answered on 01 May 2012, 01:03 PM
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?
0
Dimitar Terziev
Telerik team
answered on 03 May 2012, 10:00 AM
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.
Tags
TabStrip
Asked by
Erik
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Erik
Top achievements
Rank 1
Share this question
or