PDA

View Full Version : [CLOSED] Nested border layouts causing layout disapear



ViDom
Sep 26, 2012, 3:44 PM
Hi,

I've got weird problem here's my code:

master page:



<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Page.Master.cs" Inherits="SampleProject.Page" %>

<%@ 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">
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta http-equiv="Reply-to" content="" />
<meta name="Distribution" content="Global" />
<meta http-equiv="Content-Language" content="pl" />
<meta name="Robots" content="All" />
<meta name="Rating" content="General" />
<title>MM Ewidencja 2012</title>
<asp:ContentPlaceHolder runat="server" ID="contentHeader"></asp:ContentPlaceHolder>
</head>
<body>
<form id="aspnetForm" runat="server">
<ext:ResourceManager ID="ResourceManagerMain" runat="server" EnableViewState="true"
Theme="Default" IDMode="Legacy" ></ext:ResourceManager>
<!-- IDMode="Explicit" InitScriptMode="Linked" RemoveViewState="true" -->
<ext:Viewport ID="ViewportMainExt" runat="server" Layout="Border" MinWidth="980">
<Items>
<ext:Container Border="false" ID="PanelMenu" runat="server" Title="Menu" Region="North" Height="70"
Split="false" Collapsible="false" Header="false" AutoDoLayout="true">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Container Border="false" ID="PanelNorth" runat="server" Title="Menu" Height="40" Visible="true"
Split="false" Collapsible="false" Header="false">
<Items>
<ext:Toolbar ID="toolbarLogo" runat="server" Height="40" Cls="mme_title_toolbar">
<Items>
<ext:Label ID="labelLogo" runat="server" Text="Title" Cls="mme_title_label"></ext:Label>
</Items>
</ext:Toolbar>
</Items>
<Content>
<%--<iframe id="Iframe1" width="1" height="1" runat="server" src="TaskManager.aspx"></iframe>--%>
</Content>
</ext:Container>
<ext:Toolbar ID="MenuMain" runat="server" Height="30" Border="false">
<Items>
<ext:Button ID="MenuStart" runat="server" Text="Start" OnClientClick="window.location.href='Start.aspx'"
Icon="ColorWheel" />
</Items>
</ext:Toolbar>
</Items>
</ext:Container>
<ext:Container Border="false" ID="PanelMain" runat="server" Region="Center" Split="false" AutoScroll="true"
Collapsible="false">
<Content>
<asp:ContentPlaceHolder ID="siteContent" runat="server" ></asp:ContentPlaceHolder>
</Content>
</ext:Container>
</Items>
</ext:Viewport>
</form>
</body>
</html>



page code:



<%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="TestMaster.aspx.cs" Inherits="SampleProject.TestMaster" %>
<%@ Register tagPrefix="uc" tagName="Test1" src="controls/TestSimple.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contentHeader" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="siteContent" runat="server">
<uc:Test1 runat="server" ID="test"/>
</asp:Content>



User control code:


<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestSimple.ascx.cs" Inherits="SampleProject.controls.TestSimple" %>

<ext:Container runat="server" ID="container" Layout="Border"><%-- without Layout="Border" it's working but display is like crap --%>
<Items>
<ext:Panel runat="server" Region="North" Height="40">
<Items>
<ext:Button runat="server" Text="btn north"></ext:Button>
</Items>
</ext:Panel>
<ext:Panel runat="server" Region="Center">
<Items>
<ext:TextField runat="server" Text="center"></ext:TextField>
</Items>
</ext:Panel>
</Items>
</ext:Container>
<ext:Button runat="server" Text="btn"></ext:Button>


and here's my problem when I loading Page with copied code from TestSimple user control markup it's working fine but when I trying to load the same code but by created usercontrol it's stop working. display nothing.

How can I handle that to make it work without creating custom control(using existing user control)?

Hope my question contains enough details to help me but if not pls ask:)

Thanks,
ViDom

Daniil
Sep 26, 2012, 7:55 PM
Hi ViDom,

Please apply the following changes.

1. Set

Layout="FitLayout"
for the PanelMain.

2. Wrap the user control in a Container with FitLayout.

<ext:Container runat="server" Layout="FitLayout">
<Content>
<uc:Test1 runat="server" ID="test"/>
</Content>
</ext:Container>

ViDom
Sep 27, 2012, 7:31 AM
Hi ViDom,

Please apply the following changes.

1. Set

Layout="FitLayout"
for the PanelMain.

2. Wrap the user control in a Container with FitLayout.

<ext:Container runat="server" Layout="FitLayout">
<Content>
<uc:Test1 runat="server" ID="test"/>
</Content>
</ext:Container>

Hi Daniil,

Thanks for this fast solution :) Worked like a charm.