0
votes

We're having a very strange problem with css in DotNetNuke.

It seems that with any of our custom modules, if a user clicks to postback 9 times the skin css is removed and the page becomes rather ugly. Looking at the source the tags with the urls to the css files are gone. After one more click making 10 postbacks, any custom css files we've added are removed as well. It seems that sometimes the css will come back after more postbacks but other times it will not.

what you click on doesn't matter, just the amount of postbacks. However we have another server that on some days will behave fine, and others will have the same behavior.

We can't narrow it down to anything our modules have in common. It happens in modules that do not share any code, but somehow happens in all our modules that we've tried but not in any other modules that come with DNN.

Though experimenting we've also found you can postback say 8 times leave the page and come back, you then can postback 9 more times before the css will be gone.

2
So you are saying <link href="style.css" rel="stylesheet" type="text/css"> disappears completely? How is this tag being added to the pages?RichardOD
Yes the tag disappears completely. The two that are used for the skins are put their by DotNetNuke. The third that goes away on the 10th postback use but their with the code behind. Dim link As New HtmlLink link.Attributes.Add("rel", "stylesheet") link.Attributes.Add("href", ModulePath.Replace("//", "/") & "styles.css") link.Attributes.Add("type", "text/css") Page.Header.Controls.Add(link)Thomas
can you duplicate this in a development environment where you can have a debugger running?Jeff Martin

2 Answers

0
votes

Something link this has happened to me before but not with dotnetnuke, so it may not apply.

Anyway, my my case what was happening was i was making an ajax request that would update a table body with some new rows. on some requests, the page would lose its css styles. it looked like no styles were used on the page.

the root of the problem was that invalid html was being returned from the ajax call. actually a 500 error page was being returned by the ajax, which contained HTML tags, the whole deal. this seemed to break the styles in IE.

if "postback" == ajax request, then this may help

0
votes

This was do to not having a doc type set for the DNN skin we were using. The copyright was a side effect.