ASP.NET How do I set the position of a control at runtime?

Posted by Jamie on Stack Overflow See other posts from Stack Overflow or by Jamie
Published on 2010-04-15T14:01:22Z Indexed on 2010/04/15 14:03 UTC
Read the original article Hit count: 227

Filed under:

Hi all,

I'm adding a label to a page using the code below, how would I set the position of the label (i.e top right)?

Label lbl = new Label();
lbl.Text = "Test";
lbl.ForeColor = System.Drawing.Color.Black;
lbl.Font.Size = 10;
lbl.Font.Bold = false;
lbl.Font.Name = "Arial";
Page.Controls.Add(lbl);

Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET