Search code examples
c#cssasp.netajaxtabcontainer

Set Ajax Tab Container Width to 100%


I have an ajax container which will be created dynamically in C#. I would like the container width to be set to 100%. Have researched online for quite awhile but still can't figure out how to set the width to 100%.

This is my codes:

    //Aspx file
 <div>
             <asp:scriptmanager ID="ScriptManager1" runat="server">
            </asp:scriptmanager>
        </div>
        <asp:updatepanel ID="UpdatePanel1" runat="server" ScrollBars="Horizontal">
            <contenttemplate>
        <asp:placeholder ID="PlaceHolder1" runat="server"></asp:placeholder>

                <asp:Chart runat="server">

                </asp:Chart>

            </contenttemplate>
        </asp:updatepanel>

//Cs file
AjaxControlToolkit.TabContainer container = new AjaxControlToolkit.TabContainer();
            container.ID = "TabContainer";
            container.EnableViewState = false;
            container.Tabs.Clear();
            container.Height = Unit.Pixel(2000);
            container.Width = Unit.Pixel(2000);
            container.Tabs.AddAt(0, GetManualTab());

Question: How to set Ajax tab container width to 100% if the container is created dynamically in c#?

Appreciate if anyone provide me help on this. Thanks a lot!!


Solution

  • container.Width = Unit.Percentage(100);