Go with the flow (layout)

Mar 30, 2004 • One minute to read

Jeff Key has a handy tip on removing the /// comments for the default C# project templates in VS 2003. While I don’t like the comments, my pet peeve is that ASP.NET uses “Grid” layout by default. For your sanity, below are the directions for how to “go with the flow”.

Changing ASP.NET Pages from grid layout to flow layout

  • Navigate to the following directory: “C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddWebFormWiz\Templates\1033” (assuming C: installation and english version (aka 1033)
  • Before changing any templates it’s a good idea to make backup copies of them :)
  • Open “webform1.aspx” using Notepad, and remove the MS_POSITIONING attribute from the body tag as shown below:

<%@** **Page language="c#” Codebehind="$FILENAME$.cs” AutoEventWireup="false” Inherits="$INHERITS$” %>



**[!output SAFE_ITEM_NAME]**



Voila! You’re done!

Removing Body positioning on a per-project basis

If you don’t want to mess with the template documents, or you like Grid layout (I’ll withold judgement of you, really) for certain applications, you can change the behavior for new files on a per project basis in Visual Studio by right clicking on the project name (Ex: “WebApplication1)” in Solution Explorer, and select “Properties”. This brings up the project properties window, under Common Properties»Designer Defaults»Page Layout change “Grid” to “Flow”.


Changes to C# and .NET Framework

More coverage on C# 2.0 features