If you want to add universal codes or scripts to your websites across all pages, you must modify the skin of your website or add the script to the page header. This article describes the process of adding a universal code on your website.
- Access to the DNN server and Read and Write permissions to the file system
- Administrator or SuperUser account.
Open the Windows File Explorer.
Navigate to the folder where your DNN site is installed, and open your skin folder at
Open one of the folders for a specific skin. This will depend on which skins you have installed for your site.
Within the skin folder, open one of the .ascx files for your skin. The file you choose will depend on which pages you want to display the script on. For example, in the image below, the default skin, main.ascx, is located at
SiteRoot/Portals/_default/Skins/Cavalier/. For portals using the Cavalier skin, the main.ascx file is commonly loaded on the many pages.
Using a text editor, edit the .ascx file and append your code to the bottom of the page.
console.log("my personal code");
- Save the file.
Restart the application. For example: Navigate to Persona Bar > Servers and click Restart Application.
Browse to the site and hit on Ctrl + F5. (This clears the cache of the previous version of your page.)
You can add the script to the Page header for all the pages.
- Log in as an Administrator or SuperUser
- Go to Settings > Site Settings > Site Behavior
- Append the script in the HTML Page Header Tags section
- Click Save
Right-click on any page and select View Page Source.
The added code is present when viewed in View Page Source.
- The script executes as intended. (This requires that your included script is functional.)