Label generated in code at exact position

G

gce

I like to declare my label in the code : dim lblTotaal as new label
And then I like to place it on an exact position. When I type the following
in the HTML part it works, but I like to have my code do the trick. Please
help

<asp:Label id="lblTotaal" style="Z-INDEX: 103; LEFT: 500px; POSITION:
absolute; TOP: 500px" runat="server" Height="16px"
Width="112px">lblTotaal</asp:Label>
 
S

Steve C. Orr [MVP, MCSD]

You can use positioning code like this:
MyLabel.Attributes.Add("style, "LEFT:500px;");

Alternately, you could precisely position a placeholder control at design
time.
Then at runtime you can use some code kinda like this:

MyPlaceHolder.Controls.Add(MyLabel)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top