Click here to Skip to main content
16,020,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi coders,
I am using ajax tab container in my application.I want to bind different gridviews to get populated whenever the index of the tab is changed.On page load i want to populate one grid and when 2nd tab is clicked i want to populate the second one.I have set the auto post back property true and have written the code on Protected Sub TabContainer1_ActiveTabChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabContainer1.ActiveTabChanged but it just doesnot fire at all.How do i achieve that???
Regards,
Gourav Sharma
Posted

1 solution

Try this

Initially
VB
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
        Height="367px" Width="1000px">



C#
protected void Page_Load(object sender, EventArgs e)
   {
       if (!IsPostBack)
       {
          if(TabContainer1.ActiveTabIndex==0)
           {

//Populate GridView1
           }
          else if(TabContainer1.ActiveTabIndex==1)
           {

//poputale Grid2
           }
       }
   }
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900