UltimateTabstrip
Topic: Re: How to maintain viewstate from tab to tab.
Karamasoft Support Forums

Page 1 of 1 (8 items)


Posted by Kaashi on 10-01-2009 11:12 AM
I am using Ultimate Tab Strip as a user control in a master page.
When ever I move from one tab to another tab, selections on the tab are gone and page is reloaded. How to avoid this?
I am not using the content template, but using a URL to attach various pages to the tab.

Thanks,
Kaashi.

Posted by Karamasoft on 10-02-2009 10:17 AM
Please make sure that you set the AutoPostBack property of your UltimateTabstrip control to False to prevent postbacks when the active tab is changed. If you navigate to a different URL when you click the tabs, you will lose your selections in your page because you are not doing any postbacks when you navigate to a different URL.

Posted by Kaashi on 10-02-2009 10:54 AM
In my application we will be navigating to a different page every time a tab is clicked. I think Autopostback=False setting wouldn't help me, right? Is there any other way to keep page selections?

Thanks,
Kaashi.

Posted by Karamasoft on 10-04-2009 12:22 AM
If you are navigating to a different page by setting the URL of your page, you will lose the state of your page because it is a separate HTTP request. In order to keep the state of your page, you have to do a normal page postback by setting the AutoPostBack property to True. If you reply with your sample code and explain what exactly you are trying to achieve, we can help you better. Thanks.

Posted by alsig on 04-10-2011 12:43 AM
ok. i'm confused. Should AutoPostBack for the UltimateTabstrip be set to True or False?  I have tried both settings in this scenario - using Master Page and tabstrip as User Control - and I always lose all entries after changing tabs - regardless of AutoPostBack setting.

I notice that the Master Page and User Control samples on your website, surprisingly, also do not retain data after changing tabs.

please advise.
thanks,
alan s.


Posted by Karamasoft on 04-11-2011 10:17 AM

We tested our Master Page and User Control samples in our live demo at http://www.karamasoft.com/Samples.aspx?component=UltimateTabstrip and they work properly by retaining the selected tab after changing tabs. What spepcific OS and browser version are you testing on?

You can click on Show Code link at the bottom of the sample page to see how ActiveTabIndex is set in a method called SetActiveTabIndex method in master page's code-behind and the SetActiveTabIndex methdo is called in each ASPX page's code-behind in Page_Load event handler as follows: Master.SetActiveTabIndex(0)


Posted by alsig on 04-12-2011 9:19 PM

Setting the ActiveTabIndex in Page_Load works fine for me.  The problem is persistance - retaining the entered data (i.e. checkbox, textbox) when I switch tabs.

When I use your Master Page and User Control samples - either from the web or my local machine - the data I select is lost when I navigate away from a page, and then come back.

For example, if I select Nikon D40 6.1MP from the Products page and then click on the Purchase tab, when I go back to Products the Nikon D40 6.1MP is no longer selected.

I am using IE 8.0.6001.18702 on Windows 2003 Server SP2.
Thanks.


Posted by Karamasoft on 04-13-2011 1:44 PM
In both master page and user control samples, since you are navigating to a different page by setting the URL of your page, you will lose the state of your page because it is a separate HTTP request. In order to keep the state of your page, you have to do a normal page postback by setting the AutoPostBack property to True, which may not be suitable for master page or user control scenarios.