Results 1 to 7 of 7

Thread: Separate dynamic controls with a "<br>"

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved Separate dynamic controls with a "<br>"

    I'm adding controls to my page in code and needed <br> between the controls to put them on new lines. I just want to write <br>'s to the page without using the HtmlAnchor control. Is there a better way than this?
    Code:
    Label l1 = new Label();
    Label l2 = new Label();
    Label l3 = new Label();
    
    HtmlAnchor an1 = new HtmlAnchor();
    HtmlAnchor an2 = new HtmlAnchor();
    
    l1.Text = "Label1";
    l2.Text = "Label2";
    l3.Text = "Label3";
    
    an1.InnerHtml = an2.InnerHtml = "<br>";
    
    Page.Controls.Add(l1);
    Page.Controls.Add(an1);
    Page.Controls.Add(l2);
    Page.Controls.Add(an2);
    Page.Controls.Add(l3);
    Last edited by wey97; Apr 22nd, 2005 at 08:55 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width