[CLOSED] How should I nested ext.net.controls with user controls?

  1. #1

    [CLOSED] How should I nested ext.net.controls with user controls?

    Hi,

    I got this problem since I got my user control which have
          <ext:BorderLayout ID="BorderLayout1" runat="server"/>
    When I try to put this user control to another user control and then make
         MyUserControl myctrl = this.LoadControl("~/controls/MyUserControl.ascx");
    My page start to be empty is this normal behaviour? Is there any solution to make it start to work. I already lost 2 days of trying things with (add. ext.net.panel to my new control
    MyUserControl
    and adding to it my old control with borderlayout) And It's seems to work when I get clear page without masterpage on it. but I can't resignate from masterpage.

    Any ideas how to fix it?

    Structure of my program is like this

    Page.Master got:
    <Viewport runat="server">
    <Items>.....</Items>
    <Content> here are simple <asp:ContentPlaceHolder ID="siteContent" runat="server" /> </Content>
    </Viewport>
    my page:
    is only connected to Page.Master and got :
    <asp:Content ID="contentContainer" ContentPlaceHolderID="siteContent" runat="server">
        <asp:Panel runat="server" ID="pnDetails"></asp:Panel><%here i try to put  MyUserControl%>
    </asp:Content>
    all code for test:

    master.page:
    
    <ext:Viewport ID="ViewportMainExt" runat="server" Layout="border" MinWidth="980">
            <Items>
                <ext:Panel ID="PanelMenu" runat="server" Title="Menu" Region="North" Height="70"
                    Split="false" Collapsible="false" Header="false" AutoDoLayout="true" Layout="VBoxLayout">
                    <LayoutConfig>
                        <ext:VBoxLayoutConfig Align="Stretch" />
                    </LayoutConfig>
                    <Items>
                        <ext:Panel ID="PanelNorth" runat="server" Title="Menu" Height="40" Visible="true"
                            Border="false" Split="false" Collapsible="false" Header="false">
                            <Items>
                                <ext:Toolbar ID="toolbarLogo" runat="server" Height="40" Cls="mme_title_toolbar">
                                    <Content>
                                        <iframe id="Iframe1" width="1" height="1" scrolling="no" style="display: none;" runat="server"
                                            src="TaskManager.aspx" />
                                        <ext:Label ID="labelLogo" runat="server" Text="Title" Cls="mme_title_label" />
                                    </Content>
                                </ext:Toolbar>
                            </Items>
                        </ext:Panel>                    
                    </Items>
                </ext:Panel>
                <ext:Panel ID="PanelMain" runat="server" Region="Center" Split="false" AutoScroll="true"
                    Collapsible="false" AutoDoLayout="true" Shadow="Frame">
                    <Content>
                        <asp:ContentPlaceHolder ID="siteContent" runat="server" />
                    </Content>
                    <LoadMask ShowMask="true" Msg="Please wait ..." />
                </ext:Panel>
            </Items>
        </ext:Viewport>
    details.aspx:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="MMEwidencja.MMEWebsite.Details1" %>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <asp:Content ID="contentContainer" ContentPlaceHolderID="siteContent" runat="server">
        <ext:Panel runat="server" ID="pnDetail"></ext:Panel>
    </asp:Content>
    details.aspx.cs
    
    protected void Page_Init(object sender,EventArgs e)
            {
                     controls.ServiceOrderRepair ser =
                    (controls.ServiceOrderRepair)LoadControl("~/controls/ServiceOrderRepair.ascx");
                    ser.ID="serOrdRep";
                    pnDetail.Controls.Add(ser);           
            }
    Thanks
    ViDom
    Last edited by Daniil; Jul 06, 2012 at 3:37 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Quote Originally Posted by ViDom View Post
    all code for test:
    I can't see the source code of the ServiceOrderRepair.ascx.

    I think you should wrap the pnlDetail Panel (details.axps) in a FitLayout control.
    <ext:FitLayout runat="server">
        <Items>
            <ext:Panel ID="pnDetail" runat="server" />
        </Items>
    </ext:FitLayout>

Similar Threads

  1. Replies: 1
    Last Post: Jul 20, 2012, 8:08 AM
  2. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  3. [1.0] Web User Controls
    By lukasw in forum 1.x Help
    Replies: 7
    Last Post: Apr 12, 2010, 2:55 AM
  4. Replies: 0
    Last Post: Nov 20, 2009, 6:57 AM
  5. Replies: 4
    Last Post: Nov 04, 2008, 8:52 AM

Tags for this Thread

Posting Permissions