MVC3 Web App - IIS7 Windows Server 2008 R2 - CSS issues

Go To StackoverFlow.com

0

I am developing a MVC3 Web Application with Visual Studio 2010 Ultimate.

During development on my pc in IISExpress, everything looks as it should when viewed using IE8 and Chrome.

http://localhost:7442/

Yesterday I deployed to a Windows Server 2008 R2 environment with IIS7.

When I view the web app on the server via IE8, everything looks as it should.

http://localhost:8080

When I view the web app remotely from my pc in IE8, it seems that some of the css is messed up. Text placement is skewed, some colors are messed up, etc.

http://[servername]:8080

But when I view the web app remotely from my pc using Chrome, everything looks fine...

http://[servername]:8080

Any idea how the same site using the same files can look differently using the same browser just in different environments?

2012-04-04 20:07
by Isaac Vallee
There are many reasons this could happen. Your first step should be to clear your cache in both browsers to make sure it's not using an old cached CSS stylesheet - Keith 2012-04-04 20:10
I have cleared both caches. Same result - Isaac Vallee 2012-04-04 20:20
Have you used Fiddler to make sure that every file that is requested is being returned, so not getting any 404 or 403 errors - Nick Bork 2012-04-04 20:23
No I haven't. I will check it out.. Also, I just went to a co-workers PC and pulled up the remote website for the very first time on that PC and it has the visible issues as well - Isaac Vallee 2012-04-04 20:25
I checked out fiddler. No 404 or 403 errors. Also, I changed the background-color value in the stylesheet directly on the server. The new background color appeared in all instances, yet the other issues remained - Isaac Vallee 2012-04-04 20:43


0

Turn off (or on) Compatibility View (given it works in Chrome then i'd think on). IE, by default, sets compatibility view for sites that are on the local network.

As you mention, you can also turn this on/off in the browser settings, but if you want it to default to standards mode always, then you need to either use the x-ua-compatibile meta tag, or set the x-ua-compatible header in global.asax

2012-04-04 20:54
by Erik Funkenbusch
Wow. Thanks... Under "Compatibility View Settings", the "Display Intranet Sites In Compatibility View" checkbox was checked... I unchecked was able to toggle compatibility view from the IE toolbar and everything looks great! Thanks much - Isaac Vallee 2012-04-04 21:08
Ads