Positioning controls on a webform at runtime

  • Thread starter Thread starter Amilcar
  • Start date Start date
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.
 
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
 
Back
Top