Dynamic viewport's center area

  1. #1

    Dynamic viewport's center area

    Hi i want to create viewport dynamically to my placeholder called PlaceHolder1 and add center area's controls dynamically, i added placeholder to center area and add textbox to this placeholder but textbox do not display properly, how can i solve this problem?

    ViewPort container = new ViewPort();

    BorderLayout layout = new BorderLayout();


    Panel westPanel = new Panel();

    westPanel.Width = new System.Web.UI.WebControls.Unit(100);

    westPanel.Title = "west";

    westPanel.Html = "west";


    Panel centerPanel = new Panel();

    centerPanel.Html = "center";


    System.Web.UI.WebControls.PlaceHolder dynamicPlaceHolder = new System.Web.UI.WebControls.PlaceHolder();


    System.Web.UI.WebControls.TextBox t1 = new System.Web.UI.WebControls.TextBox();


    Panel eastPanel = new Panel();

    eastPanel.Width = new System.Web.UI.WebControls.Unit(100);

    eastPanel.Title = "East";

    eastPanel.Html = "east";


    layout.East.Split = true;

    layout.East.Collapsible = true;

    layout.West.Split = true;

    layout.West.Collapsible = true;

  2. #2

    RE: Dynamic viewport's center area

    Hi testix,

    If you comment out the centerPanel.Html = "center"; code then the layout will work correctly. To add both "text" and Controls to the BodyContainer, please add the Text as a <ext:Label> or LiteralControl.

    If the .Html is set, it will replace all the contents of the Body with the .Html value. If controls have been added to the BodyContainer, then they may (or may not) render properly. 

    Hope this helps.

    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Replies: 5
    Last Post: Jun 18, 2012, 8:47 PM
  2. Replies: 2
    Last Post: Jun 18, 2012, 6:43 PM
  3. Replies: 5
    Last Post: Mar 22, 2012, 2:12 PM
  4. [CLOSED] Center tablelayout in viewport
    By CarWise in forum 1.x Premium Help
    Replies: 5
    Last Post: Apr 01, 2011, 12:04 PM
  5. Replies: 6
    Last Post: Sep 25, 2009, 3:51 AM

Posting Permissions