views:

952

answers:

4

How to make controls float freely on asp.net webpages? It was some setting to be changed in visual studio right?

A: 

Do you mean setting the css positioning to relative instead of absolute?

Nathan Koop
to move the controls across the page as we can do in windows applications
Ahmad Farid
+3  A: 

It was MS_POSITIONING="GridLayout" in the body tag. But this is removed since Visual Studio 2005.

You can imitate this result by doing the following:

Tools - Options - HTML Designer - CSS Positioning - Positioning Options, and setting it to absolute positioned.

UPDATE:

Visual Studio 2008:

Tools - Options - Html Designer - CSS Styling - Change positioning to absolute for controls added using Toolbox, paste or drag and drop.

Ivan Zlatanov
is there a problem if i did that? i mean is it unrecommended or why did they remove it?
Ahmad Farid
My daily quota for voting is finished. Otherwise I could have upvoted you
rahul
I think they removed it, because it isn't supposed to be html tag, since only visual studio uses it. Its just wrong. You can sure use the option that visual studio offers for absolute positioning. This is absolutely fine.
Ivan Zlatanov
sorry? what do u mean, i am a newbie here.how can i do that through visual studio 2008?
Ahmad Farid
I've updated my response.
Ivan Zlatanov
A: 

Its better if you design your web page through HTML code in the source editor rather than dragging and dropping items from the tool box. By this you can have a structured design even when your page is viewed in different resolutions.

There is no harm with the solution provided by @Ivan Zlatanov if you wish drag and drop controls.

rahul
A: 

relative positioning and absolute positioning can move the element freely but relative positioning is relative to the actual positionn of the element and moving it from there... Absolute positioning is the one which move completely any where around the page by providing the left top values.