Hi - I am using Infragistics webtab (v 10.2) to move between two aspx pages and here is code snippet.
<
ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px" EnableValidation="true" EnableViewState="false">
<Tabs><ig:ContentTabItem runat="server" Text="Tab 1" ContentUrl="Page1.aspx">
</ig:ContentTabItem>
<ig:ContentTabItem runat="server" Text="Tab 2" ContentUrl="Page2.aspx">
</ig:ContentTabItem></Tabs>
<PostBackOptions EnableLoadOnDemandUrl="true" EnableLoadOnDemand="true" EnableReloadingUnselectedTab="true" EnableAjax ="true"/>
<AutoPostBackFlags SelectedIndexChanged ="On"/>
</ig:WebTab>
Here is the issue I am facing -
When I move from Tab1 (Page1.aspx) to Tab2 (Page2.aspx) Page1.aspx is loaded as expected, but Page2.aspx is loaded twice.
Am I missing any settings?
Appreciated quick response.
IE calls the TabSelectedIndexChanged twice, so you need to do something like this:
( note that these loadcnt(s) are maintained in a persisted class and cleared on page_load)
Private Sub tabRotation_SelectedIndexChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.TabSelectedIndexChangedEventArgs) Handles tabRotation.SelectedIndexChanged ' infragistics webtab event model wants to run the tabindex changed event always twice ' way too much over head involved, limit this to once only Select Case tabRotation.SelectedIndex
'Case 0 is my default tab and is loaded by default
Case 1 ' Description If (MSS_Rotation.tabDescriptionloadcnt = 0 AndAlso Request.Browser.Browser <> "IE") OrElse (MSS_Rotation.tabDescriptionloadcnt = 1 AndAlso Request.Browser.Browser = "IE") Then LoadDescription() End If MSS_Rotation.tabDescriptionloadcnt += 1 Case 2 ' Scheduling If (MSS_Rotation.tabSchedulingloadcnt = 0 AndAlso Request.Browser.Browser <> "IE") OrElse (MSS_Rotation.tabSchedulingloadcnt = 1 AndAlso Request.Browser.Browser = "IE") Then LoadSchedulingTab() End If MSS_Rotation.tabSchedulingloadcnt += 1 Case 3 ' Tags If (MSS_Rotation.tabTagsloadcnt = 0 AndAlso Request.Browser.Browser <> "IE") OrElse (MSS_Rotation.tabTagsloadcnt = 1 AndAlso Request.Browser.Browser = "IE") Then LoadTagsTab() End If MSS_Rotation.tabTagsloadcnt += 1 Case 4 ' Students If (MSS_Rotation.tabStudentsloadcnt = 0 AndAlso Request.Browser.Browser <> "IE") OrElse (MSS_Rotation.tabStudentsloadcnt = 1 AndAlso Request.Browser.Browser = "IE") Then LoadStudents() End If MSS_Rotation.tabStudentsloadcnt += 1 End Select End Sub
*Also, note that if you let the webtab sit for a couple of minutes (on a fired off tab), *then* switch to another tab *WHICH HAS NOT BEEN LOADED ON DEMAND*:
1. for IE, it might never fire off the event
2. for IE, it might never fire off the 2nd selectedindexchanged (so a persisted Boolean might be a better choice versus a counter style implementation)