Set Position of an ASP.NET Control at Runtime

By Mahesh Chand Sep 10, 2007
This tip shows how to set the position of an ASP.NET control dynamically from your code.

Yesterday, I got an email asking this question.

The LEFT and TOP attributes in the following code sets the left and top positions of a control. You can call this code from any where in your code.

For example, if I have a Calendar control and want to change the position of the control dynamically, this is the code I need to add.

Calendar1.Attributes.Item("style") = "Z-INDEX: 176; LEFT: 584px; POSITION: absolute; TOP: 176px"

Mahesh Chand

Mahesh Chand is founder of C# Corner. C# Corner founded in 1999 is a FREE member contributions based open platform for developers to solve problems, learn new technology and hang out.  Mahesh has been awar... Read more

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs