The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Go with the flow (layout)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Dan Fernandez

Posts: 456
Nickname: danielfe
Registered: Aug, 2003

Daniel Fernandez is the Product Manager for C# in the developer division at Microsoft.
Go with the flow (layout) Posted: Mar 30, 2004 8:25 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Dan Fernandez.
Original Post: Go with the flow (layout)
Feed Title: Dan Fernandez's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/danielfe/Rss.aspx
Feed Description: Dan discusses Dot Net.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Dan Fernandez
Latest Posts From Dan Fernandez's Blog

Advertisement

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$" %>
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html
>
<head
>
    <title>[!output SAFE_ITEM_NAME]</title
>
    <meta name="GENERATOR" Content
="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content
="C#">
    <meta name=vs_defaultClientScript content
="[!output DEFAULT_CLIENT_SCRIPT]">
    <meta name=vs_targetSchema content
="[!output DEFAULT_TARGET_SCHEMA]">
</head>

<body MS_POSITIONING="[!output DEFAULT_HTML_LAYOUT]">
    <form id="Form1" method="post" runat
="server">
   
</form
>
</body
>
</
html>

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”. 

Read: Go with the flow (layout)

Topic: Data Application v2 ? Previous Topic   Next Topic Topic: MDC: What a week!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use