CODEDIGEST
Home » CodeDigest
Search
 

Technologies
 

Active Tab Changed Event in Tab control in AJAX Control Toolkit
Submitted By Satheesh Babu B
On 12/9/2008 6:25:41 AM
Tags: asp.net ajax,CodeDigest  

Active Tab Changed Event in Tab control in AJAX Control Toolkit

 

By default, when we use the OnActiveTabChanged event in Tab control in AJAX control toolkit it will not call the server side event.  There are number of article which says to call doPostback method explicitly to make this event work but making this to work is as simple as calling DropDownList Selected Index changed event. To post to the server when the user changes the active tab we need to set the AutoPostBack property to true.

 

Refer the below code,

 

<cc1:TabContainer id="TabContainer1" runat="server" ActiveTabIndex="0"

OnActiveTabChanged="TabContainer1_ActiveTabChanged" AutoPostBack="true">

<cc1:TabPanel runat="server" HeaderText="My Articles" ID="TabPanel1">

    <ContentTemplate>

     <div style="text-align:center">

   

        </div>

    </ContentTemplate>

 </cc1:TabPanel>

<cc1:TabPanel runat="server"  HeaderText="My Codes" ID="TabPanel2">

    <ContentTemplate>

     <div style="text-align:center">

    

 

        </div>

    </ContentTemplate>

 </cc1:TabPanel>

</cc1:TabContainer>

 

Codebehind

protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)

{

}

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!

Recent Codes
  • View All Codes..