Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I am using Ajax tab control in one of my project.

I want to display multiple grid onClick of each tab,it having more than 8 tab now my page become to heavy so it will take lot of time to load.

And each content panel has one iframe so onclick of each tab related page open in related iframe.

Can you suggest me alternate Tab Concept so that each tab content load quickly.

I want to keep Tab Concept only.
Posted

1 solution

Hi Mahesh,

There will be one event in Ajax tab container called onactivetabchanged, use this event and write the code for each tab panel when the activetabindex was changed. And make sure you've set AutoPostback=true. Find the below sample code FYR,

ASP.NET
<asp:tabcontainer id="tbhead" runat="server" xmlns:asp="#unknown">
	            ActiveTabIndex="0" AutoPostBack="true"
                    Width="100%" Height="100%" onactivetabchanged="tbhead_ActiveTabChanged">
                    <asp:tabpanel id="tab1" runat="server" headertext="sample">
<!-- your code here --></asp:tabpanel></asp:tabcontainer>


In .CS file,

C#
protected void tbhead_ActiveTabChanged(object sender, EventArgs e)
        {
                         
                if (tbhead.ActiveTabIndex == 0)
                {                   
                    //Your code here
                }
                else if(tbselfappr.ActiveTabIndex == 1)
                {
                  //Your code here                 
                }
       }
 
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