Jul 19, 2012, 9:14 AM
-
-
Jul 19, 2012, 9:34 AMIf combine the markup and code behind the result will look like this:
Example
That is wrong. A layout control must be a single top level control within a user control.<ext:Container runat="server" > <Items> <ext:Button runat="server" /> </Items> </ext:Container> <ext:BorderLayout runat="server"> <North> <ext:Panel runat="server" /> </North> <Center> <ext:Panel runat="server" /> </Center> </ext:BorderLayout>
-
Jul 19, 2012, 9:40 AMI doesn't know that :(
So what's your propose to handle this? I can't change my someControlBorderLayout.ascx and I need to put on control SpecialControlContainer.ascx some extra buttons. -
Jul 19, 2012, 12:10 PMI can't change my someControlBorderLayout.ascx
Anyways, you can add buttons just to the Container. -
Jul 19, 2012, 12:20 PMYeah I can't change markup (if there are possibility to virtualize BorderLayout display behaviour in way to make display elements all the time in same place(now it's done with North Center South tags)?).
in South region I got TabPanel with tabs which at the begin of page Should be Collapsed When there is no South region this TabPanel even when collapsed showing Tab in it which is incorrect.
What do you mean to add buttons to container in previous post of yours you said I can't make such a thingThat is wrong. A layout control must be a single top level control within a user control.
Now I'm really confused. Can you please explain what do you mean?:) -
Jul 19, 2012, 2:30 PMI mean the following.
Example User Control
Please clarify why can't you create the Container (which is defined in the markup) in the code behind as well as additional Buttons, BorderLayout, etc.?<%@ Control Language="C#" %> <script runat="server"> protected void Page_Init(object sender, EventArgs e) { this.Container1.Items.Add(new Ext.Net.Button() { Text = "Added from the code behind" }); } </script> <ext:Container ID="Container1" runat="server" > <Items> <ext:Button runat="server" Text="Defined in the markup" /> </Items> </ext:Container>
-
Jul 19, 2012, 3:04 PMIt's not a problem to create Container. But how this will help? I tryed to create Container and then add to him my userControl with BorderLayout in it but it's result is a blank page without any controls at all. When I deleted borderLayout from my control it's display fine with 1 disturb detail.
TabPanel with Tabs should be at bottom on the page but now it isn't
screen of problem
Is there any way to make it happend without borderLayout and south region in it? -
Jul 19, 2012, 3:22 PMUsing BorderLayout for your layout looks a good option.
You should place the Container into the BorderLayout as well.
If you would clarify with a mockup how the things should exactly look I could suggest a possible layout. -
Jul 19, 2012, 3:38 PM
-
Jul 19, 2012, 3:59 PMGood, thanks.
Here how I would implement that mockup.
Example Master Page
Example User Control 1 (TestUC.ascx)<%@ 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="Master North" Height="200" /> <ext:Panel runat="server" Region="Center" Title="Master Center"> <Content> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server" /> </Content> </ext:Panel> </Items> </ext:Viewport> </form> </body> </html>
Example User Control 2 (TestUC2.ascx)<%@ Control Language="C#"%> <%@ Register TagPrefix="ext" Namespace="Ext.Net" %> <script runat="server"> protected void Page_Init(object sender, EventArgs e) { this.Panel1.Items.Add(new Ext.Net.Button() { Text = "Added from the code behind" }); Control uc = this.LoadControl("TestUC2.ascx"); this.Panel2.ContentControls.Add(uc); } </script> <ext:VBoxLayout runat="server" Align="Stretch"> <BoxItems> <ext:BoxItem> <ext:Panel ID="Panel1" runat="server" Title="Buttons" Height="100"> <Items> <ext:Button runat="server" Text="Defined in the markup" /> </Items> </ext:Panel> </ext:BoxItem> <ext:BoxItem Flex="1"> <ext:Panel ID="Panel2" runat="server" Title="Content" /> </ext:BoxItem> </BoxItems> </ext:VBoxLayout>
Example Content Page<%@ 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> <South Collapsible="true"> <ext:TabPanel runat="server" Height="100"> <Items> <ext:Panel runat="server" Title="Tab 1" /> <ext:Panel runat="server" Title="Tab 2" /> </Items> </ext:TabPanel> </South> </ext:BorderLayout>
<%@ 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>
Similar Threads
-
Dynamic User controls with window controls is not working
By vs.mukesh in forum 1.x HelpReplies: 1Last Post: Jul 20, 2012, 8:08 AM -
[CLOSED] How should I nested ext.net.controls with user controls?
By ViDom in forum 1.x Legacy Premium HelpReplies: 1Last Post: Jul 04, 2012, 11:14 AM -
[1.2] FitLayout doesn't render with user controls or other controls in a UserControl
By michaeld in forum 1.x HelpReplies: 5Last Post: Nov 03, 2011, 2:39 AM -
[CLOSED] Problem with GridPanel controls and FileUploadField controls in the same page
By csharpdev in forum 1.x Legacy Premium HelpReplies: 2Last Post: Feb 16, 2011, 9:10 AM -
When using GridPanel controls and FileUploadField controls in the same page ,the IE6 Progress Bar still looks like its loading
By scaujwc in forum 1.x HelpReplies: 0Last Post: Jan 05, 2011, 6:48 AM