I'm dynamically adding tabs but am finding they lose state when I tab away and tab back. The code I'm using is as follows:
function create_tab(tabName, resourceId) {
var url = "/Home.aspx?resourceId=" + resourceId; var tabControl = $find("<%= WebTab1.ClientID %>"); tabControl.addTab(tabName, url, null);}
The problem is that when you:
1) Click a link within that tab to navigate to a new location
2) Click on a different tab
3) Navigate back to the original tab. It is no longer on the last screen but instead, reloads Home.aspx
Am I missing a PostBackEvent?
Thanks
Hi,
The behavior related to ContentUrl depends on PostBackOptions.EnableLoadOnDemandUlr and EnableReloadingOnTabClick properties, so, you may check their values and experiment with them.
If you have a postback (or autopostback) on tab change events or postbacks between your actions, then original value of ContentUrl will be used, so, in this case your redirect will be lost.
When tabs are changed on client (without postbacks), then visibility of content-panes associated with tabs are modified. If that action triggers browser to reset the url in iframe which visibility was toggled, then I am in doubt that similar feature of a browser can be disabled. WebTab does not do that "reset" action until properties, which I mentioned are enabled.