Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Going crazy w/ absolute positioning

Status
Not open for further replies.

bbwrede

Programmer
May 22, 2003
52
US
Hi, I need help figuring out the vb.net IDE. I am taking over an aspx w/ vb code behind project and I don't understand how to edit the form. When I try to add a label or anything the label jumps to the top left of the page and if I try to cursor down the label jumps to the bottom of the page. Everything is absolute positioned so it will be hard for me to add what I need to in the code.

Any suggestions? Any books or online reference suggestions.

Thanks,
Barb
 
Barb -
As far as I know, absolute positioning works fine, you just have to add the following to each object, for example, if you have a text box:

<asp:Textbox id=&quot;lblTest&quot; runat=&quot;server&quot;/>

...and you want it located at such and such location, simply add:

style=&quot;Z-INDEX: 101; LEFT: 393; POSITION: absolute; TOP: 420&quot;

resulting in:

<asp:Textbox id=&quot;lblTest&quot; runat=&quot;server&quot; style=&quot;Z-INDEX: 101; LEFT: 393; POSITION: absolute; TOP: 420&quot;/>

...in which the object is placed at Left:393 and down from the Top at 420.

Otherwise, strip out some or all of the absolute positioning statements, add a table (with 0 border) and align via horz/vert alighment techiques.

Either way seems to work just fine. I have never had any problems with absolute positioning. If you just add the style statement and the coordinates, it'll go where you say.

To edit? Use Notepad to open the aspx page. You can edit just fine there.

 
Change the Documents's pageLayout property from FlowLayout to GridLayout. The absolute positioning will be automatically added for you.
 
Boulder -

Good point. In Visual Studio it is automatic, and can save you a lot of time.
 
BTW, you don't need to use absolute positioning. I use a combination of dreamweaver and Visual Studio. I create all of the tables in dreamweaver and then paste into VS (and remove MS_Positioning attribute of <body> tag
 
jg --

Good point. I try to avoid absolute positioning, favoring instead the alignment of objects within table cells setting the border to zero, and centering, etc... within each table cell.
 
You can do that in VS.NET too, but I dig the grid positioning in many cases! It can be sooo frustrating and time consuming dealing with the auto-alignment stuff of pages and tables, and it's convenient to just drag a control where you want it and forget about it.
 
I hear ya Boulder, can go either way; and the absolute positioning is great, and saves lots of time, and is neat, etc.. Not sure if there are any &quot;browser&quot; limitations to same. Keeps object in certain location etc.

The reason I prefer table cells (and yes, sometimes it can be a pain) is I like the &quot;fluidness&quot; of the page, i.e., ability to flow with page size, etc.. Also, when &quot;text&quot; size is changed, table cells &quot;open up&quot; and allows &quot;breathing space&quot; for letters. I tend to get overlap in those situaitons.

Its a 50:50, perhaps with more siding with absolute positioning (not that I don't use it) -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top