locked
Set Ajax Tab Container Width to 100% RRS feed

  • Question

  • User-471962099 posted

    hi, 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!!

    Wednesday, September 30, 2015 8:38 PM

Answers

  • User281315223 posted

    You should be able to use a Percentage unit as opposed to a Pixel :

    container.Width = Unit.Percentage(100);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 1, 2015 11:18 AM

All replies

  • User281315223 posted

    You should be able to use a Percentage unit as opposed to a Pixel :

    container.Width = Unit.Percentage(100);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 1, 2015 11:18 AM
  • User-471962099 posted

    hi Rion Williams,  solved! thanks for your help! :)

    Best Regards,

    Felicia

    Thursday, October 1, 2015 11:22 PM