Absolute Position of Control on Web Form

Is there a way of setting the absolute position of a control on a web Form?

In most samples, positioning is done with a table. I want to do it programmatically by setting the absolute position of a control added programmatically to the page.

Your help is very much appreciated
Beat

[689 byte] By [beat] at [2008-2-19]
# 1

Hi,

Please take look at the code snippet below. Adding a TextBox dynamically and then settings its absolute positioning.

Code sample uses .NET 2.0 Beta 2
--
CODE SNIPPET
--
protected void Page_Load(object sender, EventArgs e)
{
TextBox objTextBox = new TextBox();
objTextBox.Text = "Sample";
//style="left: 100px; position: absolute;top: 100px"
objTextBox.Style.Add("position", "absolute");
objTextBox.Style.Add("left", "100");
objTextBox.Style.Add("top", "100");
Page.Form.Controls.Add(objTextBox);
}
--

Regards,
Vikram

Vikram at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2

Would it be possible to see the VB2005 version of this ?

Davester at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified