Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Webtab Control twice postback
posted

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.

Parents
  • 1708
    Offline posted

    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

Reply Children