CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo [MVP]

Software management consultant and CTO, Headspring Systems

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.

Here's a page from Microsoft that explains this more.




Comments

Raymond Lewallen said:

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?
# July 5, 2005 10:59 AM

Jeffrey Palermo said:

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).
# July 5, 2005 11:11 AM

Geoff Appleby said:

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

:)
# July 5, 2005 4:59 PM

Jeffrey Palermo said:

As I mentioned before, I'm at a new company, and I'm one of the .Net developers working on Shadows.com.&amp;nbsp;...
# July 19, 2005 12:56 PM

Jeffrey Palermo said:

I originally was going to label this post level 200, but given how few people know about Html standards,...
# July 29, 2005 11:45 AM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

This Blog

Syndication