Position Web control within Panel on Web Form ... programatically

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Position Web control within Panel on Web Form ... programatically

    Is it possible to position a Web Form control within a
    Panel ... programattically? That is, by adding lines to
    the following code:


    protected System.Web.UI.WebControls.Panel Panel1;

    private void Page_Load(object sender, System.EventArgs e)
    {
    Panel1.BackColor= System.Drawing.Color.White;
    Panel1.Height=95;
    Panel1.Width=200;
    System.Web.UI.WebControls.DropDownList DDL1 = new
    DropDownList();
    DDL1.Height=30;
    DDL1.Width=120;
    Panel1.Controls.Add(TB2);
    }

    or, some other way?

    Thanks.

    M- Guest

  2. Similar Questions and Discussions

    1. Creating a custom user control programatically
      I created a composite control derived from UserControl. It has two textboxes. The ascx file looks like this: <%@ Control Language="C#"...
    2. control panel
      what icon was in between printer&faxes and regional whicxh is now blank. thanks
    3. Having trouble adding a web user control programatically.
      Hi All; I am attempting to figure out how to add a user created control (test.ascx) to an ASP.NET page based on a user choice. I have created a...
    4. Programatically created controls in an ascx user control misbehaving
      Hello I have a need to dynamically (programatically) create various different controls (TextBox, RadioButtonList, CheckBox, etc.) at page_load...
    5. Problem with web user control loaded programatically
      I am loading web user controls into a web page programitically using the cone below: private void Page_Load(object sender, System.EventArgs e) ...
  3. #2

    Default Position Web control within Panel on Web Form ... programatically

    An sample code - server-side or client-side would be
    appreciated.

    >-----Original Message-----
    >Is it possible to position a Web Form control within a
    >Panel ... programattically? That is, by adding lines to
    >the following code:
    >
    >
    >protected System.Web.UI.WebControls.Panel Panel1;
    >
    >private void Page_Load(object sender, System.EventArgs e)
    >{
    > Panel1.BackColor= System.Drawing.Color.White;
    > Panel1.Height=95;
    > Panel1.Width=200;
    > System.Web.UI.WebControls.DropDownList DDL1 = new
    >DropDownList();
    > DDL1.Height=30;
    > DDL1.Width=120;
    > Panel1.Controls.Add(TB2);
    >}
    >
    >or, some other way?
    >
    >Thanks.
    >
    >.
    >
    M- Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139