Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET website looks different when deployed

I have googled around for the answer to this question, but haven't come up with anything. Maybe the search terms I used were too generic... Anyway, here goes:

I am discovering the joys of web design and ASP.NET, and the nightmare of trying to get things to display in the same way in IE and all the other browsers. I am working in VS2010 and debugging my website using IE8. What I really don't get is why the website once I publish it looks different in IE from the way it looks in debug mode... I mean small things only, like border in gridviews disappearing in the published site, simple html horizontal rules aren't the same either.

It also messed up my list menu pretty bad, but I managed to fix that with the *display: inline; hack. The weird thing is that it doesn't need it in debug mode, but needs it for the published website.

I am hosting the site on my own machine, running Win XP Pro and hosting through IIS with .NET 4.0... Could the issue be IIS related?

Any help would be much appreciated, because those differences are just ridiculous and are driving me to desperation. I wish everyone over here would use Chrome or Safari, but unfortunately IE still rules in Japan...

like image 868
David Avatar asked Mar 02 '11 09:03

David


1 Answers

This works for me, overrides the setting in ie

META Tag in HEAD element of your web page (or better in master page)

<meta http-equiv=“X-UA-Compatible” content=“IE=8” />

link here to info http://blogs.msdn.com/b/askie/archive/2009/03/23/understanding-compatibility-modes-in-internet-explorer-8.aspx

like image 159
kgp4death Avatar answered Sep 19 '22 02:09

kgp4death