1. Original Entry + Comments2. Write a Comment3. Preview Comment
New comments for this entry are disabled.


November 21, 2005  |  Grid and Flow modes in Visual Web Developer  |  18471 hit(s)

I've seen this question a couple of times on the forums: what happened to Grid mode (and Flow mode) in the Visual Studio Web page designer? In VS2003, the default was Grid mode, with the option to switch to Flow mode.[1] In reality, of course, Grid view is absolute (css) positioning, and flow mode is, uh, no positioning. (I'd say it's "normal" HTML, but I don't think we can say that non-CSS positioning of HTML elements is necessarily the norm these days.)

Anyway, you can still get the effect of Grid mode, no problem. To be able to x/y position a single control, select it in Design view and then choose Layout > Position > Absolute. Drag and enjoy. You can multi-select if you are so inclined.

To emulate a perma-Grid-mode, choose Layout > Position > Auto-position Options. There you will find a checkbox with a caption way too long to type out, so I'll just show you a picture:



Check the box and select the positioning option you need. Note that static is a positioning option that has exactly the same effect as Not Set, which means no attribute set at all.

Selecting this option doesn't turn the whole design surface into using Grid mode -- it just adds x/y coordinates to any new controls you add via the common UI gestures. Controls that aren't already configured for x/y positioning will still be static.

There is actually a reason for this change. An overarching philosophy for the Web page editor in this release was "no designer goo in the page." (To, um, paraphrase slightly.) In VS2003, as you'll remember, we implemented Grid mode by adding non-standard attributes to the <body> tag:

<body MS_POSITIONING="GridLayout">

None of that this time around. We output only the finest, board-approved markup.


[1] Or to drop a Grid panel thingy onto a Flow mode page.




Milan Negovan   12 Dec 05 - 8:10 AM

It's great that MS_POSITIONING="GridLayout" is not the default any more. I think it's done a lot more damage than good because it encouraged bad design practices. There's nothing wrong with absolute positioning with CSS, but the way it was done in VS.NET 2003 was plain wrong.

A lot of people didn't ever realize they were using absolute positioning---controls would just "stick" where they placed them. :) It got people to think they were developing desktop apps, but doing it for the web. The two don't go together. I stressed it in my article at http://www.aspnetresources.com/articles/remastering_web_templates.aspx.

IMO, the old web form template was horrible, and I sure appreciate the new one.