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]
12/30/2006 6:10:05 AM (Central Standard Time, UTC-06:00)
Thank you thank you thank you John ... this ia great..and I love the idea it works in html and ascx so even beginners in DNN and skinning can work with it.

Nina
1/14/2007 6:36:04 AM (Central Standard Time, UTC-06:00)
Thanks John. Just integrating some MS AJAX controls (the accordion) into a Virtual Earth Map and thought i was in for a long night. Changing the doc type to xhtml did the trick. I now it is so easy! Thanks.
John.
2/28/2007 7:34:00 PM (Central Standard Time, UTC-06:00)
This is a great step forward for DNN, and though your solution is a bit of a hack, I like where we're headed.

This move to XHTML begs the question, however -- is the rest of the DNN 4.4 ASPX code XHTML compliant? Will it validate?
2/28/2007 8:31:05 PM (Central Standard Time, UTC-06:00)
Hi Bryan,
It's only a hack because of the way it was implemented to start with.
Setting the Doctype this way is much better than using the method currently in the core.

No, the rest of the DNN 4.4.x code does not validate XHTML strict.
But I have a way around that also, without loosing performance.

Take a look at my home page on Snapsis.com for example htpp://www.snapsis.com
12/4/2007 8:19:49 AM (Central Standard Time, UTC-06:00)
very nice
1/17/2008 11:56:13 AM (Central Standard Time, UTC-06:00)
This worked perfectly for me, thank you! I'm pretty new to DNN and don't want to mess with upgrading our installation on our local server (using version 04.07.00) so I had to find another way to change the DTD.

Thanks!
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):