Master Page with ContentPlaceHolder: FitLayout Content not stretching vertically

  1. #1

    Master Page with ContentPlaceHolder: FitLayout Content not stretching vertically

    Hi,

    I am using ext.net 1.2 and .Net 4.0 and I have an issue with what I am trying to do.

    I have a master page with a Viewport, a BorderLayout and a asp:ContentPlaceHolder in the Center region:

     
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:Viewport runat="server">
    
                <Content>
                    <ext:BorderLayout runat="server">
                        <Center>
                            <ext:Panel ID="centerPanel" runat="server" AutoScroll="true" Layout="FitLayout">
                                <Content>
                                    <asp:ContentPlaceHolder ID="main" runat="server" />
                                </Content>
                            </ext:Panel>
                        </Center>
    
                    </ext:BorderLayout>
                </Content>
            </ext:Viewport>
    My content page simply contains a asp:Content refering to my ContentPlaceHolder, a panel and a text area:
            <asp:Content ContentPlaceHolderID="main" runat="server">
                <ext:Panel runat="server" Layout="FitLayout">
                    <Content>
                        <ext:TextArea runat="server" Text="this is a text area" />
                    </Content>
                </ext:Panel> 
            </asp:Content>
    I've put FitLayout so that the content controls take all the available space, but it is stuck with a height of 60 pixels. It only expands horizontally and does not seem to resize correctly when I resize my browser window.

    Am I missing something or is it a limitation of the combination of controls I have used ?

    Thank you,

    Olivier
  2. #2
    Hi,

    The Layout property doesn't make any sense for such combination:
    <ext:Panel runat="server" Layout="FitLayout">
        <Content>
            <asp:ContentPlaceHolder ID="main" runat="server" /> <%--as well for a user control--%>
        </Content>
    </ext:Panel>
    But there is a way to get it working wrapping a placeholder content in an <ext:FitLayout> control.

    Example
    <asp:Content ContentPlaceHolderID="main" runat="server">
        <ext:FitLayout runat="server">
            <Items>
                <ext:Panel runat="server" Layout="FitLayout">
                    <Items>
                        <ext:TextArea runat="server" Text="Hello World" />
                    </Items>
                </ext:Panel>
            </Items>
        </ext:FitLayout>
    </asp:Content>
  3. #3
    Thank you Daniil for your answer.

    It works now.

    But when should I use a FitLayout element instead of a Panel with Layout="FitLayout" ? I am unsure of the difference between each of them...

    Olivier
  4. #4
    You should use a FitLayout control in your case and in a similar case with a user control.

    For any container with Items, you can set up Layout property.

Similar Threads

  1. Replies: 0
    Last Post: Aug 14, 2012, 2:59 PM
  2. Replies: 0
    Last Post: Jul 30, 2012, 10:39 AM
  3. Replies: 4
    Last Post: Feb 13, 2012, 2:21 PM
  4. [CLOSED] Data on the TextField content is not centered vertically.
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 21, 2011, 12:06 AM
  5. Replies: 2
    Last Post: May 05, 2010, 10:23 AM

Tags for this Thread

Posting Permissions