[CLOSED] Restricion in nesting Ext.Net.Controls?

Page 1 of 5 123 ... LastLast
  1. #1

    [CLOSED] Restricion in nesting Ext.Net.Controls?

    Hi,

    Are there some common restriction of nesting Ext.Net controls in v1.3 ?

    I wonder if there is any place to read about it because for now I make my GUI like blind person and can't deduce how to make this nesting to make sure that will be working :(

    For now I have realy complicated layout and each time when I need to add simple panel to my application my heart start beat faster because it's can make crush of entire application.
    Last edited by Daniil; Jul 20, 2012 at 1:43 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Are there some common restriction of nesting Ext.Net controls in v1.3 ?
    Generally, no. You can use as many nested containers/layout as you wish.

    If you are facing some concrete issue, please provide more details.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,



    Generally, no. You can use as many nested containers/layout as you wish.

    If you are facing some concrete issue, please provide more details.
    I think I will provide some concrete tommorrow;)
  4. #4
    Daniil I've send you an email with my problem let me know if you get it:)
  5. #5
    Thank you, but our policy is do not consider the unsolicited emails from the forums, please see #7 C):
    http://forums.ext.net/showthread.php?3440

    Please post sample files here simplifying as much as you can.

    Please note you can place the code behind directly on ASPX wrapping in:
    <script runat="server">
        ...
    </script>
    Please see Example (Very Helpful) following the link I have posted.
  6. #6
    Ok I doesn't know ;)

    my page.master file:
    <%@ Master Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server" id="idPageHeader">
        <asp:ContentPlaceHolder runat="server" ID="contentHeader" />
    </head>
    <body>
        <form id="aspnetForm" runat="server">
        <ext:ResourceManager ID="ResourceManagerMain" runat="server" EnableViewState="false"
            Theme="Default" />
        <!--  IDMode="Explicit" InitScriptMode="Linked" RemoveViewState="true" -->
        <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="title_toolbar">
                                    <Content>
                                        <ext:Label ID="labelLogo" runat="server" Text="Title" Cls="mme_title_label" />
                                    </Content>
                                </ext:Toolbar>
                            </Items>
                        </ext:Panel>
                        <ext:Toolbar ID="MenuMain" runat="server" Height="30">
                            <Items>
                                <ext:Button ID="MenuStart" runat="server" Text="Start" OnClientClick="window.location.href='Start.aspx'"
                                    Icon="ColorWheel" />
                                <ext:ToolbarSeparator ID="SeparatorStart" runat="server" />
                                
                                <ext:Button ID="lbtnLogout" runat="server" Text="Logout" Icon="DoorIn">
                                    <DirectEvents>
                                        <click onevent="lbtnLogout_Click" />
                                    </DirectEvents>
                                </ext:Button>
                                <ext:ToolbarSeparator ID="SeparatorUserName" runat="server" />
                                <ext:Button ID="lbtnUserName" runat="server" Text="User" Icon="User" ToolTip="User profile">
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </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>
        </form>
    </body>
    </html>
    Details.aspx:
    <%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" %>
    
    <script runat="server">
        private UserControl ser;
            protected void Page_PreInit(object sender, EventArgs e)
            {
            }
    
            protected void Page_Init(object sender,EventArgs e)
            {
                    ser = (UserControl)LoadControl("~/controls/Details/Device.ascx");
    
                    ser.ID = "device_detail";
                    
                    ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("siteContent");
                    cph.Controls.Add(ser);              
            }
    
            protected void Page_Load(object sender, EventArgs e)
            {
                
            }
    </script>
    
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <asp:Content ID="contentContainer" ContentPlaceHolderID="siteContent" runat="server">
    </asp:Content>
    Device.ascx:
    <%@ Control Language="C#"%>
    
    <script runat="server">
            protected void Page_Init(object sender, EventArgs e)
            {
                
                HtmlGenericControl div = new HtmlGenericControl("DIV");
                Ext.Net.Button btnNotification = new Ext.Net.Button();
                btnNotification.Text = "zgłoszenie";
                div.Attributes.CssStyle.Add("class", "specialButtonsContainer1");
                div.Controls.Add(btnNotification);
                this.Controls.Add(div);
                Ext.Net.BorderLayout borderLayout = new Ext.Net.BorderLayout();
                Ext.Net.Panel panel = new Ext.Net.Panel();
                System.Web.UI.WebControls.Button btn = new System.Web.UI.WebControls.Button();
                btn.ID = "test";
                btn.CssClass = "button";
                panel.Controls.Add(btn);
                borderLayout.North.Items.Add(panel);
                Ext.Net.Panel panelCenter = new Ext.Net.Panel();
                MultiView mView = new MultiView();
                View vView = new View();
                View vEdit = new View();
                mView.Controls.Add(vView);
                mView.Controls.Add(vEdit);
                panelCenter.Controls.Add(mView);
                borderLayout.Center.Items.Add(panelCenter);
                UserControl user = new UserControl();
                user.Controls.Add(borderLayout);
                this.Controls.Add(user);
                
            }
    
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    </script>
    
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" Assembly="Ext.Net, Version=1.3.0.2809, Culture=neutral, PublicKeyToken=2e12ce3d0176cd87" %>
    
    <ext:Panel runat="server" Height="31">
        <Items>
        <ext:Button runat="server" ID="btnAddNotification"  IconAlign="Left" Text="add notification" Icon="ErrorAdd" Cls="topButton" />
            <ext:Button runat="server" ID="btnAddServiceOrder" IconAlign="Left" Text="add service" Icon="NoteAdd" Cls="topButton" />
            <ext:Button runat="server" ID="btnCopyDevice" IconAlign="Left" Text="copy device" Icon="PageWhiteCopy" Cls="topButton">
                    <Listeners>
                        <Click Handler="return confirm('Are you sure you want to do it?');"></Click>
                    </Listeners>
                </ext:Button>
            <ext:Button runat="server" ID="btnPrint" IconAlign="Left" Text="print" Icon="Printer" Cls="topButton" />
        </Items>        
    </ext:Panel>
    and now describe of problem :

    when I add to Device.ascx.cs file some userControl which contains borderlayout in it and I got in Device.ascx file some controls added. Then My application get crushed.

    When I've clear Device.ascx and Add user control with borderlayout in it it's working fine.


    Please let me know what I'm doing wrong with layout.
  7. #7
    I am not sure what layout you are trying to achieve.

    Please note that only Ext.NET components can participate in the layout logic. But you have added a <div> as one of the top level controls in the user control.

    Also I don't think you need that:
    UserControl user = new UserControl();
    user.Controls.Add(borderLayout);
    There are also some more things which confuse me.

    Lets start from some basic example.

    Example Master Page
    <%@  Master Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel 
                        runat="server" 
                        Region="North" 
                        Title="Main North" 
                        Height="200" />
                    <ext:Panel runat="server" Region="Center" Title="Main Center">
                        <Content>
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
                        </Content>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Example Content Page
    <%@ Page Language="C#" MasterPageFile="Master.Master" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <%@ Register Src="~/TestUC.ascx" TagPrefix="uc" TagName="TestUC" %>
    
    <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <uc:TestUC runat="server" />
    </asp:Content>
    Example User Control
    <%@ Control Language="C#"%>
     
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" %>
    
    <ext:BorderLayout runat="server">
        <North>
            <ext:Panel runat="server" Title="Nested North" Height="100" />
        </North>
        <Center>
            <ext:Panel runat="server" Title="Nested Center" />
        </Center>
    </ext:BorderLayout>
  8. #8
    Quote Originally Posted by Daniil View Post
    I am not sure what layout you are trying to achieve.

    Please note that only Ext.NET components can participate in the layout logic. But you have added a <div> as one of the top level controls in the user control.

    Also I don't think you need that:
    UserControl user = new UserControl();
    user.Controls.Add(borderLayout);
    There are also some more things which confuse me.

    Lets start from some basic example.

    Example Master Page
    <%@  Master Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Viewport runat="server" Layout="BorderLayout">
                <Items>
                    <ext:Panel 
                        runat="server" 
                        Region="North" 
                        Title="Main North" 
                        Height="200" />
                    <ext:Panel runat="server" Region="Center" Title="Main Center">
                        <Content>
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" />
                        </Content>
                    </ext:Panel>
                </Items>
            </ext:Viewport>
        </form>
    </body>
    </html>
    Example Content Page
    <%@ Page Language="C#" MasterPageFile="Master.Master" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <%@ Register Src="~/TestUC.ascx" TagPrefix="uc" TagName="TestUC" %>
    
    <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <uc:TestUC runat="server" />
    </asp:Content>
    Example User Control
    <%@ Control Language="C#"%>
     
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" %>
    
    <ext:BorderLayout runat="server">
        <North>
            <ext:Panel runat="server" Title="Nested North" Height="100" />
        </North>
        <Center>
            <ext:Panel runat="server" Title="Nested Center" />
        </Center>
    </ext:BorderLayout>

    I made that
     UserControl user = new UserControl();
    user.Controls.Add(borderLayout);
    to make sure you will know I've to load dynamically userControl like
    SomeUserControl userControl = (someUserControl)LoadControl("someControl.ascx");
    and this someControl.ascx file looks like:
    <%@ Control Language="C#"%>
     
    <%@ Register TagPrefix="ext" Namespace="Ext.Net" %>
    
    <ext:BorderLayout runat="server">
        <North>
            <ext:Panel runat="server" Title="Nested North" Height="100" />
        </North>
        <Center>
            <ext:Panel runat="server" Title="Nested Center" />
        </Center>
    </ext:BorderLayout>
    now I see I don't write this question clear enough.

    thissomeControl.ascx in my case is dynamically build form to handle all kind of common objects behaviour in applications such as saving/updating/deleting but at some special form I would like to add some special buttons which will do something and that's why I need this structure:

    page.master => Details.aspx (LoadControl("SpecialUserControl.ascx")) =>SpecialUserControl.ascx => here I simply LoadControl("someControl.ascx") + at the top of that loaded control I want to add 1-10 buttons when I do this my application crushed

    ALL what need to happend have to happen dynamically in codebehind in *.ascx of SpecialUserControl I can add only buttons which i describe a little higher at this post

    Do you now what am I trying to do?
  9. #9
    Quote Originally Posted by ViDom View Post
    Do you now what am I trying to do?
    Well, yes, I do.

    I have used the markup because it is much more demonstrative than code behind. Everything which is achieved in the markup is possible to implement in code behind.

    You could take my example, extend it as you need step by step and, then it will be broken, post here.
  10. #10
    I' ll try but for now my VS got mad and I can't add any reference to new project;/
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Replies: 1
    Last Post: Jul 20, 2012, 8:08 AM
  2. [CLOSED] How should I nested ext.net.controls with user controls?
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2012, 11:14 AM
  3. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  4. Replies: 2
    Last Post: Feb 16, 2011, 9:10 AM
  5. Replies: 0
    Last Post: Jan 05, 2011, 6:48 AM

Tags for this Thread

Posting Permissions