How to set DOCTYPE on DotNetNuke 4.4.x or greater

24. January 2008 14:15 by viperguynaz in DotNetNuke  //  Tags:   //   Comments (0)

Recently, I was experimenting with LightWindow in a DotNetNuke portal.  The scripts work great in Firefox, but were giving me fits in IE7.  I checked out the LightWindo forums and discovered the fix was setting the DOCTYPE to:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

So, from there my quandry was how to set the DOCTYPE in a DNN Portal.  Well, In 4.4 and above, you are able to define the xhtml mode as a part of the skin by adding an xml file that that is named [SKINNAME].doctype.xml. Within this xml file you should declare one node SkinDocType. Then, within a CDATA tag, you add the doctype declaration to be used for this skin.  For example, if your page uses Portal.ascx as the skin, you would create Portal.doctype.xml in the same directory.  Be careful though, changing the DOCTYPE might have nasty side effects on some skins.  The xml file should have the following content:


<SkinDocType><![CDATA[<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]></SkinDocType>

 
 

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

After 20 years flying F-16s in the USAF, I've had a ton of fun and I'm now doing something I enjoy almost as much, developing code.  I currently work as an ASP.NET/MVC developer for SpinSix Strategic Marketing Design in Scottsdale AZ.  I love developing ASP.NET MVC and eCommerce sites.

Month List

Page List