DotNetNuke Powered!
          
John Mitchell's (mostly DotNetNuke) Blog - DotNetNuke 4.4 DocType
 Friday, December 29, 2006

Brand new in DNN 4.4 is the option to change your Doctype  which Cathal blogged about.

As Cathal pointed out in this thread the implementation will need to be improved for performance because on every request the DNN framework is looking for an XML file and loading it into an XML Document to validate the XML.

There is also concern that it is hard to implement with multiple skins because you would need a different XML file for every Skin.

You can shortcut all of this now and not take the performance hit by using the code below.

Just copy and paste the following code directly into your HTML or .ASCX skin file.

<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim skinDocType as Control = Me.Page.FindControl("skinDocType")
   If Not skinDocType is Nothing
      CType(skinDocType, System.Web.UI.WebControls.Literal).Text="<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"">"
   End If
End Sub
</script>

12/29/2006 7:58:23 PM (Central Standard Time, UTC-06:00)  #    Comments [6]