Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Resources

Jeremy Farrance edited this page Oct 17, 2020 · 5 revisions

The proper way to get DNN to include a resource on a page is to use either DnnJsInclude or DnnCssInclude. You can do this in themes using the SkinObjects, in code by calling these functions, or even just dropping them on the page as needed (see /Portals/0/2sxc/Content/Shared/_Assets.cshtml for examples).

Example (not recommended) showing both ASYNC and DEFER

<dnn:DnnJsInclude 
  FilePath="https://kit.fontawesome.com/9999999999.js"
  ForceProvider="DnnFormBottomProvider"
  Priority="100"
  HtmlAttributesAsString="async:async,defer:defer,crossorigin:anonymous"
  runat="server"
/>

Results in:

<script src="https://kit.fontawesome.com/90e9235c3d.js" async="async" defer="defer" crossorigin="anonymous" type="text/javascript"></script>

Notes:

  • we like to pronouce "resources," "race horses."
Clone this wiki locally