1

I have a ajax tab container which I created dynamically in C#. I would like to know how to add a Css class to this ajax tab container in C#.

This is my codes:

    public void tabContainer()
        {
            //Create new TabContainer
            AjaxControlToolkit.TabContainer container = new AjaxControlToolkit.TabContainer();
            container.ID = "TabContainer";
            container.EnableViewState = false;
            container.Tabs.Clear();

if (ListBox.SelectedValue == "Select All")    //If 'Select All' option is selected from ListBox
            {
                foreach (ListItem item in ListBox.Items)
                {
                    if (item.Text == "Select All")
                    {
                        continue;
                    }
                    AjaxControlToolkit.TabPanel panel = new AjaxControlToolkit.TabPanel();
                    panel.HeaderText += item.Text;
                    container.Tabs.Add(panel);

Appreciate if someone help me on this. Thanks a lot!!

1 Answer 1

2

use the following:

container.CssClass = "ClassName";

more info here: https://ajaxcontroltoolkit.codeplex.com/wikipage?title=TabContainer%20and%20TabPanel%20Controls&referringTitle=Tutorials

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.