Changing the skin/container has no efffect in DotNetNuke (DNN)? Here is a quick fix

By | January 30, 2017

I recently upgraded my DotNetNuke (DNN) Website. I had developed a custom responsive skin using Bootstrap. I had tested the same in my dev environment and everything was working fine so I updated the live environment.

Even though there were no errors reported, when I tried to change the skin, it was giving me the old skin. I tried every possible combination at Admin and Host level but changing the skin had no effect. I explicitly checked if the skin is defined at the page level or not but the drop down was showing “Default Skin” and “Default Container” for each page and module. Searching on the internet provided 2-3 unanswered threads but that was it.

So I thought of digging directly into the database and see what I can find. I queried the table dbo.Tabs and saw the column SkinSrc and ContainerSrc was populated. Strange enough, only few tabs had explicit values set for skin and container. Hidden and Admin tabs did not have the skin/container values set. So I assumed that it was related to some upgrade script which caused this issue. I ran the UPDATE query against the dbo.Tabs table to make those values NULL. Then I needed to clear the cache by going to Host > Host Settings > Clear Cache. Everything worked fine for the page.
Now the problem occurred for certain modules which had the old container. So… you bet. The table dbo.TabModules had the column ContainerSrc populated for certain rows which was causing an issue. Once I made those entries NULL, everything worked as expected after clearing cache.

Here are bunch of queries that I used

-- Get existing portals and note down PortalID

SELECT *
FROM dbo.PortalAlias
ORDER BY PortalID

-- Use appropriate PortalID in the queries below

-- Get a list of all the tabs to view associated skin and container
SELECT TabName, Title, Description, SkinSrc, ContainerSrc 
FROM dbo.Tabs
WHERE PortalID = 0

-- Get a list of all the modules to view associated container

SELECT t.TabName, t.Title, tm.ModuleTitle, tm.ContainerSrc
FROM dbo.TabModules tm
	INNER JOIN dbo.Tabs t ON t.TabID = tm.TabID
WHERE t.PortalID = 0

-- MOST IMPORTANT: BACKUP YOUR DATABASE AND THEN AND ONLY THEN EXECUTE FOLLOWING QUERIES

-- Make the skin and container values NULL at Tab/Page level
UPDATE dbo.Tabs 
SET SkinSrc = NULL, ContainerSrc = NULL 
WHERE PortalID = 0

-- Make the container values NULL Module level 

UPDATE dbo.TabModules
SET ContainerSrc = NULL
WHERE TabID IN (
	SELECT TabID 
	FROM dbo.Tabs
	WHERE PortalID = 0
)
Vishal Monpara is a full stack Solution Developer/Architect with 12 years of experience primarily using Microsoft stack. He is currently working in Retail industry and moving 1’s and 0’s from geographically dispersed hard disks to geographically dispersed user’s mind leveraging geographically dispersed team members.

Leave a Reply

Your email address will not be published. Required fields are marked *