Problem with loading AjaxTab panel Dynamically
<p>In my one of asp.net application I hve one customer search and I am displaying Results to grid. Once the user select a customer I am loading an ajax tab panel dynamically and each tab I am loading usercontrols. But in application i need to display 15-20 tabs each containg usercontrols with some different datas. So my application taking too much time to load the page. </p>

<p>Following are my code snippest. is thr any way to speed up my app.</p>

<p>ArrayList tablist = (ArrayList) Session["Tablist"];
        for (int i = 0; i &lt; tablist.Count/2; i++)
        {
            Table tbl = new Table();
            TableRow tr3 = new TableRow();
            TableCell tc3 = new TableCell();
            TableRow tr2 = new TableRow();
            TableCell tc2 = new TableCell();
            TableRow tr1 = new TableRow();
            TableCell tc1 = new TableCell();
            TabPanel tabPan = new TabPanel();
            tabPan.HeaderText = ((Tabs)tablist[i]).Name.ToString();
            tabPan.ID = ((Tabs)tablist[i]).Position.ToString();
            tabPan.SkinID = ((Tabs)tablist[i]).TabId.ToString();
            tabPan.CssClass = "panelProfile";
            Panel pnl = new Panel();
            pnl.ID = "pnl" + i;
            pnl.CssClass = "panelProfile";
            pnl.Style.Add("width", "99%");</p>

<pre><code>        tbl.Style.Add("width", "100%");

        if (((Tabs)tablist[i]).PreDefinedTabId == 0)
        {
            pnl.Style.Add("height", "400px");
            //System.Web.UI.HtmlControls.HtmlGenericControl htmlgen = new System.Web.UI.HtmlControls.HtmlGenericControl();
            Label lblmg = new Label();
            lblmg.ID = "lblmg" + i;
            Button btnSave = new Button();
            btnSave.CssClass = "button";
            btnSave.ID = "btnProfileSave" + i;
            btnSave.Text = "Save";
            btnSave.CausesValidation = true;
            btnSave.Click += new EventHandler(ProfileSave_Click);
            tc2.Controls.Add(lblmg);
            tc3.Controls.Add(btnSave);
        }
        else
        {

            try
            {
                DelegateWithParameters delPara = new DelegateWithParameters(LoadUserControlusingDelegate);
                IAsyncResult ar = delPara.BeginInvoke(((Tabs)tablist[i]).PreDefinedTabId, MyMethodCallback, delPara);

                DelegateWithParameters myDelegate = ar.AsyncState as DelegateWithParameters;
                Control myControl = myDelegate.EndInvoke(ar);
                pnl.Controls.Add(myControl);
                //string fileName = cs.GetFileName(((Tabs)tablist[i]).PreDefinedTabId);
                //Control myUserControl = (Control)Page.LoadControl("UserControls/" + fileName);
                //pnl.Controls.Add(myUserControl);
                //Control myControl= LoadUserControlusingDelegate(((Tabs)tablist[i]).PreDefinedTabId);

                //string fileName = cs.GetFileName(((Tabs)tablist[i]).PreDefinedTabId);
                //Control myUserControl = (Control)Page.LoadControl("UserControls/" + fileName);
                //pnl.Controls.Add(myUserControl);
            }
            catch (Exception ex)
            {
                this.PnlErrorMessages.Visible = true;
                this.lblErrorMessage.Text = GetMessage("Global.Message.Error");
            }
        }
        tc2.Style.Add("text-align", "left");
        tr3.Controls.Add(tc2);
        tc3.Style.Add("text-align", "right");
        tr3.Controls.Add(tc3);
        tr3.Style.Add("text-align", "right");
        tbl.Controls.Add(tr3);
        tabPan.Controls.Add(tbl);
        tabPan.Controls.Add(pnl);
        this.TabScreen.Controls.Add(tabPan);


    }
</code></pre>
