This is a migrated thread and some comments may be shown as answers.

Postback & Conditional CSS

6 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alan T
Top achievements
Rank 1
Alan T asked on 28 Mar 2011, 01:47 PM
Surprised i've only just noticed this. But in my master page, i have a conditional CSS statement that loads a different stylesheet if the user is using ie7 or below.

I've noticed that when a postback occurs, this stylesheet is always being loaded. For example, as far as i know ie7 & below don't support things like inline-block, so in my ie7 stylesheet i have all elements taht would be inline-block as inline. I'm doing this in firefox too, yet my ie7 stylesheet is loaded after a postback.

    <!--[if lte IE 7]><link href="stylesheet-ie7.css" rel="stylesheet" type="text/css" /><![endif]-->

Thats my conditional statement.

Very odd behaviour.

6 Answers, 1 is accepted

Sort by
0
Alan T
Top achievements
Rank 1
answered on 30 Mar 2011, 11:53 AM
anyone?
0
Peter
Telerik team
answered on 31 Mar 2011, 06:47 AM
Hi Alan,

Do you use RadStyleSheetManager? Can you send us the code of your implementation?


Best wishes,
Peter
the Telerik team
0
Alan T
Top achievements
Rank 1
answered on 01 Apr 2011, 12:07 PM
I'm not no. Although, i did just test it with stylesheetmanager to see if it made a difference, which it didn't.

The page is massive so providing the source would be loads.

http://www.amr-worldwide.com/propertylistings.aspx

The page is live there.

You can replicate the problem by selecting a country. Which causes an ajax postback. You'll then notice, that the radio buttons below then change to display:inline, and if you check the source you can see its because it's loaded the ie7 stylesheet.

This is just one example. I hadn't actually noticed it till i was developing another site and a similar thing was happening.
0
Jon Rowell
Top achievements
Rank 1
answered on 16 Apr 2011, 05:59 AM
I'm having the exact same problem.  I tried adding the stylesheet using javascript (EX: if $.browser.msie) { load stylesheet } with the exact same result.  Any ideas?
0
Accepted
Jon Rowell
Top achievements
Rank 1
answered on 16 Apr 2011, 06:04 AM
0
Alan T
Top achievements
Rank 1
answered on 21 Apr 2011, 05:19 PM
Thanks david, moving it into the body seemed to resolve it. Providing the older browser stylesheet still gets loaded on older browsers, which i haven't mangaged to test yet.

Alan
Tags
General Discussions
Asked by
Alan T
Top achievements
Rank 1
Answers by
Alan T
Top achievements
Rank 1
Peter
Telerik team
Jon Rowell
Top achievements
Rank 1
Share this question
or