Positioning controls on a webform at runtime

A

Amilcar

Hi there,

I'm trying to change the position on a webform for a control (a Table
control), at run time. The code I wrote for doimg this is:

....
Table.Style.Add("LEFT", "120");
Table.Style.Add("TOP", "50");
....

The placed the component on design time and I'm trying to change some
of it's atributes. I supose this is right, but it doesn't appear to
work. Is there something wrong?

I appreciatte any kind of help.

My best regards,

Amilcar.
 
M

Munsifali Rashid

Have you checked that the HTML being rendered is correct? (by using View
Source on the rendered webform). This problem can be caused if the position
property is not specified.

The following may fix your problem:

// Tell the table to use absolute positioning
Table.Style.Add("position", "absolute");

// Define position
Table.Style.Add("left", "120px");
Table.Style.Add("top", "50px");

Hope this helps,

Mun
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top