Working around IE8 for mobile responsive website in DNN (.net, vb, .aspx)

Hi, I'm developing websites using the DNN (DotNetNuke) Content management system (.net, .vb, .aspx pages). I've implemented a mobile friendly strategy by using media queries in the css, but of course IE8 and other old browsers don't support media queries and it breaks the site in those browsers.

I would like to find a way to serve different .css when IE8 (or other old browsers) are used. How can I do that inside my skin files (.ascx vb)?

Any help is appreciated!!


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
One possibility is CSS3 Media Queries

Another is Respond.js:
David S.Commented:
JavaScript can be used but that seems like a lot of unnecessary overhead to me, so I use a conditional comment to load the large screen stylesheet (e.g. desktop) in IE 8 and older:

<link rel="stylesheet" href="css/mobile.css" media="all">
<link rel="stylesheet" href="css/desktop.css" media="all and (min-width: 720px)">
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" href="css/desktop.css" media="all">

Open in new window

The trick then becomes remembering to keep styles outside of media query blocks which you want those old IE versions to use. Sometimes I'll have a style inside a media query block in the mobile stylesheet and then add it to the desktop stylesheet as well, outside of any media query blocks.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.