0

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.

Thomas
  • 1,177
  • 1
  • 14
  • 26
  • So you are saying disappears completely? How is this tag being added to the pages? – RichardOD Jul 08 '09 at 19:21
  • 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 Jul 08 '09 at 19:33
  • can you duplicate this in a development environment where you can have a debugger running? – Jeff Martin Jul 14 '09 at 15:23

2 Answers2

0

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

mkoryak
  • 57,086
  • 61
  • 201
  • 257
  • I've seen it before where someone was doing something weird logic stored in the session to generate URLs. They had some very weird code in the Global.asax App_Start event and didn't know about ResolveUrl. – RichardOD Jul 08 '09 at 19:30
  • Yes but this does not happen when using ajax. It happens after 9 postbacks. – Thomas Jul 08 '09 at 19:34
  • Richard the tags disappear completely and we have not put anything in the global.asax – Thomas Jul 08 '09 at 19:36
  • this will happen if you put something weird into the DOM. does a postback do this? – mkoryak Jul 08 '09 at 19:42
0

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

Thomas
  • 1,177
  • 1
  • 14
  • 26