Server Side Event

1 Oct 20154 minutes to read

The following server side event is available in the Tab control.

Event Event Description Argument Details
OnTabItemActive It raises when Active Tab is changed. Event Argument contains the following parameters:
e.NewSelectedItem - Current Selected index value.
e.OldSelectedItem - Previous index value.
e.EventType - Event Name
e.Arguments - Contain keys and values for prevActiveIndex and ActiveIndex.

In the ASPX page, add the Tab control to configure Tab events.

  • HTML
  • <%--Add serverside event for Radio Button control as follows--%>
    
    <ej:Tab ID="pizzaMenu" runat="server" Width="650px" OnTabItemActive="pizzaMenu_TabItemActive">
    
        <Items>
    
            <ej:TabItem ID="gardenfresh" Text="GARDEN FRESH (Veg)">
    
                <ContentSection>
    
                    <img src="http://js.syncfusion.com/demos/web/images/accordion/garden-veggie.png"
    
                        alt="garden-fresh" />
    
                    <div class="ingredients">
    
                        Rate : $50
    
                        <br />
    
                        Ingredients : cheese, onions, green capsicums & tomatoes.
    
                    </div>
    
                </ContentSection>
    
            </ej:TabItem>
    
            <ej:TabItem ID="cornandspinach" Text="CORN & SPINACH (Veg)">
    
                <ContentSection>
    
                    <img src="http://js.syncfusion.com/demos/web/images/accordion/corn-and-spinach-05.png"
    
                        alt="garden-fresh" />
    
                    <div class="ingredients">
    
                        Rate : $70
    
                        <br />
    
                        Ingredients : cheese, sweet corn & green capsicums.
    
                    </div>
    
                </ContentSection>
    
            </ej:TabItem>
    
            <ej:TabItem ID="chickendelite" Text="CHICKEN DELITE (Non-veg)">
    
                <ContentSection>
    
                    <img src=" http://js.syncfusion.com/demos/web/images/accordion/chicken-delite.png"
    
                        alt="garden-fresh" />
    
                    <div class="ingredients">
    
                        Rate : $100
    
                        <br />
    
                        Ingredients : cheese, chicken chunks, onions & pineapple chunks.
    
                    </div>
    
                </ContentSection>
    
            </ej:TabItem>
    
        </Items>
    
    </ej:Tab>

    Then Define pizzaMenu_TabItemActive server side event in the code behind.

  • C#
  • protected void pizzaMenu_TabItemActive(object sender, Syncfusion.JavaScript.Web.TabEventArgs e)
    {
    
    	//e.NewSelectedIndex – Current selected index value.
    
    	//e.OldSelectedIndex – Previous index value.
    
    	//e.EventType – Event Name
    
    	//e.Arguments – Contains Keys and Values for prevActiveIndex and activeIndex
    
    }