Results 1 to 1 of 1

Thread: Here's How to Change Your Default DOCTYPE

  1. #1

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Here's How to Change Your Default DOCTYPE

    For a year I always wanted to change the DocType Visual Studio assigns to new webforms...

    here's the answer:

    Anytime you add a new web page, you're using automation aspects of VS to put that web page into your project.

    That default web page actually exists on your hard drive. If you want to change it, go to the locations listed below for your language. All you need to do is open up WebForm1.aspx in your IDE, and configure it as you see fit. In my case I changed the archaic doctype to the fully qualified doctype
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 >

    to

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

    If you use the old doctype as delivered with VS, IE6, FireFox and other browsers don't properly enter quirks mode and you will have a hell of a time acheiving cross-browser compatibility. IE6 throwsback to IE5 rendering bugs if you don't have a fully qualified doctype.

    Anyway, here's the location of the template WebForms (remember, you're looking to change WebForm1.aspx and it doesn't hurt to make a backup copy in case you mess it up):

    C#:
    C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpAddWebFormWiz\Templates\1033

    VB:

    C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\WebForm\Templates\1033
    Last edited by nemaroller; Jul 15th, 2005 at 09:16 PM. Reason: change of title

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width