Absolute Position for Controls in Asp.net

By default for controls placed in the designer the layout position is as ‘Not Set’ thus we cannot drag the control to a specified location.


We have to change the layout position to absolute position to achieve that.

In Visual Studio we can make the default postion as we need.For that we have to enable the css postioning of controls.

Here is how we can do

1. Go to Layout->Position->Auto-position Options->HTML Designer–>CSS Styling

or

2. Go to Tools->Options->HTML Designer–>CSS Positioning

And check “Change positioning to the following for controls added using Toolbox, paste or drag and drop” and select the postion you perfer.Here we select Absolute Positioning.

Now we can move the controls placed in the designer with absolute positioning.

The Given Procedure is for Visual Studio 2005 which is same for Visual Studio 2008.

Popularity: 12% [?]

You can leave a response, or trackback from your own site.

2 Responses to “Absolute Position for Controls in Asp.net”

  1. Anonymous says:

    Can i position the controls programmatically if so how?

  2. Joy says:

    Yes u can do it programmatically

    ex :
    TextBox1.Style.Add(“left”, “500px”);

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars