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
285
WebTab SelectedIndex event is not working?
posted

Hi,

I kept one label control at top to display the selected Index, But it isnot working. My .aspx code,

<asp:Label ID="TabId" runat="server"></asp:Label>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="upPanel" runat="server">
    <ContentTemplate>
        <ig:WebTab ID="WebTab1" runat="server" Height="500px" Width="500px"  >
        <AutoPostBackFlags SelectedIndexChanged ="On" />
        <PostBackOptions EnableLoadOnDemandUrl="false" EnableAjax="true" EnableReloadingUnselectedTab="true" />
            <tabs>
                <ig:ContentTabItem runat="server"
                    Text="Infragistics" ToolTip="Infragistics">
                </ig:ContentTabItem>
                <ig:ContentTabItem runat="server" Text="Mphasis"
                    ToolTip="Mphasis">
                </ig:ContentTabItem>
                <ig:ContentTabItem runat="server" Text="Tab 3" >
                </ig:ContentTabItem>
</tabs>
        </ig:WebTab>
        </ContentTemplate>
        </asp:UpdatePanel>

My Codebehind :

protected override void OnInit(EventArgs e)
    {
        WebTab1.SelectedIndexChanged += new TabSelectedIndexChangedEventHandler(TabChanged);
        base.OnInit(e);
    }

    protected void TabChanged(object sender, TabSelectedIndexChangedEventArgs args)
    {
        int actIdx = args.NewIndex - 1;
        TabId.Text = "BY Actual value is " + actIdx + 1;
    }

Let me know, how do I know which tab is clicked?

Thanks in Advance.

  • 24497
    posted

    Hi,

    If you need to visually see on client effects of changes implemented on server, then you need to keep in mind following.

    1. Controls located outside UpdatePanel are not updated while processing async postback of that UpdatePanel. To see similar changes you need a full postback: drop asp:Button outside UpdatePanel and click it to see if your previous change worked.

    2. If you inserted WebTab into UpdatePanel, then there is no reason to use EnableAjax. It is like to have 2 nested UpdatePanels.

    I suggest you to insert TabId into UpdatePanel and remove EnableAjax.