Adding a line break to a Panel-Object

Discussion in 'ASP .Net' started by Thomas Reichgruber, Jan 31, 2004.

  1. Hi,

    does anybody know how to add a linebreak dynamically to a Panel?
    In the code behind file aspx.cs my webapplication dynamically adds
    WebControls to a Panel defined in the .aspx file. This looks like this:

    Button MyButton = new Button();
    MyPanel.Controls.Add(MyButton);

    This works great, but if I add another Button (or TextBox, or CheckList or
    ....) ASP.NET puts all Controls in the same line which looks awful.

    So I need a way to add a line break (maybe as an special WebControl object)
    to the Panel.
    Is this possible or is there a way to add HTML code (e.g. <br>) to the
    Panel?

    Thanks
    Thomas
     
    Thomas Reichgruber, Jan 31, 2004
    #1
    1. Advertising

  2. MyPanel.Controls.Add(New LiteralControl("<br>"))

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Thomas Reichgruber" <> wrote in message
    news:bvgosr$75c$-online.net...
    > Hi,
    >
    > does anybody know how to add a linebreak dynamically to a Panel?
    > In the code behind file aspx.cs my webapplication dynamically adds
    > WebControls to a Panel defined in the .aspx file. This looks like this:
    >
    > Button MyButton = new Button();
    > MyPanel.Controls.Add(MyButton);
    >
    > This works great, but if I add another Button (or TextBox, or CheckList or
    > ...) ASP.NET puts all Controls in the same line which looks awful.
    >
    > So I need a way to add a line break (maybe as an special WebControl

    object)
    > to the Panel.
    > Is this possible or is there a way to add HTML code (e.g. <br>) to the
    > Panel?
    >
    > Thanks
    > Thomas
    >
    >
     
    Kevin Spencer, Jan 31, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    553
    Harry Singh
    Nov 10, 2003
  2. HS1
    Replies:
    3
    Views:
    490
  3. HS1
    Replies:
    4
    Views:
    8,302
    Babu Kalakrishnan
    Dec 8, 2004
  4. JC
    Replies:
    1
    Views:
    750
    Michael Rauscher
    Aug 9, 2006
  5. Replies:
    12
    Views:
    971
Loading...

Share This Page