How to avoid reloading content everytime user clicked a tab?

Hi,

Here is the code,

            tabbar = new dhtmlXTabBar("tabbar", "top");
            tabbar.setImagePath("dhtmlx/tabbar/imgs/");
            tabbar.setStyle("dhx_skyblue");
            tabbar.addTab("home", "Home", "100px");
            tabbar.addTab("anothertab", "Another Tab", "100px");
            tabbar.setHrefMode("iframe")
            tabbar.setContentHref("home", "Home.aspx");
            tabbar.setContentHref("anothertab", "Test.aspx");
            tabbar.setTabActive("home");

Every time I click on each tab, the aspx will be reloaded again. Did I do anything wrong? Or there’s a way to avoid it?

Hi,

in case of “iframe” loading mode a tabbar uses only one iframe for all pages. Therefore, the content is reloaded each time you choose the new tab.

Try to use “iframes” or “iframes-on-demand” to solve the problem:

tabbar.setHrefMode( “iframes-on-demand”);

Thanks, you saved my life :wink: Finally, I can go to sleep… BTW, what’s “iframes-on-demand”?

tabbar in “iframes-on-demand” mode renders an iframe for each tab as well as in case of “iframes”. The difference between these mode is that “iframes-on-demand” loads a page only when a tab is actived for the first time (“iframes” loads all pages at once).