Hello,
I am using Load on Demand in WebTab control (I need to load the tab content only when the user is clicking on a tab).
The PostBackOptions property EnableLoadOnDemand is "true" and I am using aspx pages inside the tabs. (Each tab has the ContentUrl property set to "something.aspx")
The Load on demand works fine when the aspx page inside the tab is in the same directory as the aspx page containing the WebTab control. When the aspx page inside the tab is not in the same directory as the WebTab page, the Webtab is loading already loaded tab.
Is this a WebTab component issue or is something going on with my code?
Here is my WebTab configuration :
<ig:WebTab ID="WebTab1" runat="server">
<PostBackOptions EnableLoadOnDemandUrl="true" EnableAjax="false"/>
In page_load,
Tab1.ContentUrl = "Tab1Content.aspx",
Tab2.ContentUrl = "Tab2Content.aspx" and
Tab3.ContentUrl = ResolveClientUrl("~/OtherDirectory/Tab3Content.aspx")
Could you please help me with the above issue?
Thanks
Hi ocornuau,
Thank you for posting in the community.
In this scenario you may wish to try and set the ContentURLs of the tabs in another folder without "~/"
WebTab1.Tabs[2].ContentUrl = "NewDir/Nested.aspx";
WebTab1.Tabs[2].ContentUrl =
Alternatively you may use absolute paths to resolve the URL:
WebTab1.Tabs[2].ContentUrl = "/YourProjectName/NewDir/Nested.aspx";
Please let me know if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Hi Petar,
Thanks for answering so soon.
I've already tried your solution but it doesn't work. The tab is still loaded on every click.
Do you have another idea?
Thank you for your reply.
I have tried to replicate behavior using version 11.2 by setting the ContentURL strings in the manner you have but so far LoadOnDemand seems to be operating correctly in my case. After investigating this further and contacting our developers it seems that skipping reload of relative URLs is not supported by WebTab.
WebTab checks on the client the value of ContentUrl with actual src of IFRAME. That will not work if relative URL with ../ or similar is used, because there is no match.
Application may avoid resetting IFRAME.src by processing the client Initialize event of WebTab and changing server-URLs to client URL for all or for some tabs. However, in this case Tab.get_contentUrl() on client or Tab.ContentUrl on server will return not value, which was set on server, but client value or IFRAME.src. WebTab, can not do that as built-in action.
Below is some sample code to implement that:
<script type="text/javascript">function WebTab1_Initialize(sender, eventArgs) { var tabs = sender.get_tabs(); for (var i = 0; i < tabs.length; i++) { var tab = tabs[i]; if (tab.get_contentUrl()) // note: second parameter of true will not reset IFRAME.src, but only change value of ContentUrl tab.set_contentUrl(tab.get_iframe().src, true); } } }</script><ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px"> ... <ClientEvents Initialize="WebTab1_Initialize" /></ig:WebTab>
{ var tabs = sender.get_tabs(); for (var i = 0; i < tabs.length; i++) { var tab = tabs[i]; if (tab.get_contentUrl()) // note: second parameter of true will not reset IFRAME.src, but only change value of ContentUrl tab.set_contentUrl(tab.get_iframe().src, true);
} }
}</script><ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px"> ... <ClientEvents Initialize="WebTab1_Initialize" /></ig:WebTab>
Attached is also my working sample which you could test to see if the issue persists there.
Please let me know if this is helpful.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Thank you for your cooperation. I tried your sample code and it works, but not in my case because the aspx file containing the WebTab is in another folder than the default application directory. I have modified your sample accordingly.
You will notice that I have created another folder (NewDir2) containing the WebTab aspx file and Tab1 and Tab2 aspx files.
If you put a breakpoint on the Page_Load method from Nested.aspx you will notice that every time you select this tab he will be reloaded (it's not the case for Default2.aspx and Default3.aspx).
I would appreciate your quick response!
Thank you for the sample.
I was able to replicate the behavior and this seems to be case with unsupported skipping reloads described in my previous post.However, I was able to set the URL of the tab in question so that it is loaded only once is by uhandling the client side Initialize event and giving is the absolute URL. For instance:
function WebTab1_Initialize(sender, eventArgs){ sender.get_tabs()[2].set_contentUrl("http://localhost:XXXX/WebTabContentURL/NewDir/Nested.aspx", true);}
Please contact me if you have any questions.
I am following up to check whether you have been able to resolve your issues. Please let me know if you need further assistance regarding this matter.
Please feel free to contact me with any updates or questions.
Sincerely,
Petar Ivanov
I am going to try your solution and I'll let you know if it works. I just wanted to add that my actual code works fine in IE6 and 7. The problem appears when using IE8,9, Firefox and Chrome.
I will keep you posted.