Click here to Skip to main content
15,886,815 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Ajax Control ToolKit TabContainer is displaying on my local machine with IIS 7.5 and .Net 4.5 but after deployment TabContainer is not displaying and IIS version on server is 7.0.


Here is the code:
I am Creating Tabs Dynamically.
C#
private void AddFieldsInsideTab()
{
    for (int i = 0; i < 4; i++)
    {
        Table tbGrid = new Table();
        TableRow trGrid = new TableRow();
        TableCell tcGrid = new TableCell();

        TextBox txtB = new TextBox();
        txtB.ID = "txtB" + i;

        tcGrid.Controls.Add(txtB);

        Button btnShowText = new Button();
        btnShowText.Text = "Show Text" + i;
        btnShowText.ID = "btn" + i;
        btnShowText.Click += new EventHandler(btnShowText_Click);

        tcGrid.Controls.Add(btnShowText);

        trGrid.Cells.Add(tcGrid);
        tbGrid.Rows.Add(trGrid);
        tbcDynamic.Tabs[i].Controls.Add(tbGrid);
    }
    PlaceHolder1.Controls.Add(tbcDynamic);
}

void btnShowText_Click(object sender, EventArgs e)
{
    //throw new NotImplementedException();
    TextBox txt = (TextBox)(tbcDynamic.ActiveTab.FindControl("txtB" + tbcDynamic.ActiveTabIndex));
    lblMessage.Text = txt.Text;
    //Response.Write(txt.Text);
}

protected void Page_Init(object sender, EventArgs e)
{
    try
    {
        createTab();
    }
    catch (Exception ex)
    {
        // lblError.Text = ex.Message;
    }
}

private void createTab()
{
    tbcDynamic = new TabContainer();
    tbcDynamic.Width = 500;

    for (int i = 0; i < 4; i++)
    {
        TabPanel Panel1 = new TabPanel();
        Panel1.HeaderText = "New Tab" + i;
        Panel1.ID = "Tab" + i.ToString();
        tbcDynamic.Tabs.Add(Panel1);
    }
}
Posted
Updated 25-May-15 1:40am
v3

1 solution

 
Share this answer
 
Comments
Merajuddin Ansari 25-May-15 7:04am    
I tried it's not working and using .Net Frame Work version 4.5.

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