Switch Internet Explorer 6.0 to standard-compliant mode – level 200
It’s very easy to have IE render your web pages using current web
standards, but IE operates in “quirks” mode quite a bit, but it depends
on the web author. If you are using ASP.NET 1.1 with VS 2003,
then this doctype is added for you automatically:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
If you leave this, IE will not render your page using web
standards. The problem is that the full Url to the DTD is not
included.
To switch IE 6 to standards-mode, change the Doctype to this:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
This is the minimum you should do to every page you create with
ASP.NET. There are other doctypes you should use for other
reasons, but at least change the Doctype to make IE render in
standards-mode.
Might be a dumb question, but I’m not a GUI person. Is this configurable somewhere so that when you create a web form, the you don’t have to change it everytime? I know some things, like specifying which object the code-behind class inherits from, is in machine.config. Is this is someplace to be customized as well?
If there was a setting, it would be in Visual Studio, and I’m not aware that it exists. You can always create your own templates to customize the default content of a particular file type, but you would have to do that yourself. VS 2005 will default to Xhtml 1.0 transitional. (that’s the current plan, anyway).
Compliance mode is a must, especially doing funky stuff like I did here: http://codebetter.com/blogs/geoff.appleby/articles/49529.aspx
For a good description of the doctypes, I found this page to be extremely useful – http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp
🙂