views:

254

answers:

3

This is so odd to me.. I have IIS 5 running on XP and it's hosting a small ASP.Net app for our LAN that we can access by using the computer name, virtual directory, and page name (http://matt/smallapp/customers.aspx), but you can also hit that IIS server and page from the internet because I have a public IP that my firewall routes to the "Matt" computer (like http://213.202.3.88/smallapp/customers.aspx [just a made-up IP]). Don't worry, I have Windows domain authentication is in place to protect the app from anonymous users.

So all the abovea parts works fine. But what's weird is that the Border of the divs on the page are rendered much thicker when you access the page from the intranet, versus the internet, (I'm using IE8) and also, some of the div layout (stretching and such) acts differently. Why would it render different in the same browser based on whether it was reached from the LAN vs. the internet? It does NOT do this in FireFox. So it must be just an IE8 thing.

All the CSS for the divs is right in the HTML page, so I do not think it is a caching matter of a CSS file.

Notice how the borders are different in these two images:

Internet: http://twitpic.com/hxx91 .

Lan: http://twitpic.com/hxxtv

+1  A: 

It's most definitely because websites located on internal networks is rendered in quirks mode by default by IE8, while pages located on the Internet will determine rendering mode based on doctype. This means that while you are browsing your page over the Internet, the doctype declaration of that document dictates the rendering mode, while if you are browsing on the Intranet, IE8 uses the IE7 rendering engine.

Rendering mode can be explicitly overridden, by the user changing the IE compatibility settings, or, by always forcing IE8 to use the IE8 rendering engine, adding a meta tag to the page:

<meta http-equiv="X-UA-Compatible" content="IE=8" />
baretta
Wow! Perfect! You are one very smart rascal. When I posted this question, I said to myself, "No one will take the time read all these details, much less know the answer, and they will probably just write me off as a crazy who doesn't know what he's doing." Thanks very much.
MattSlay
A: 

You can also change the "IntranetCompatibilityMode" (HKCU/Software/Microsoft/Internet Explorer/Browser Emulation/IntranetCompatibilityMode) registry setting for IE, this will cause IE to render intranet pages in the same way as if they where internet

Jules345~

jules345
A: 

BIG Thanks guys. I couldn't work out why my site displayed okay when I was using the Asp.Net Development server but when I tested it on our Intranet using IIS 6, certain pages didn't display correctly. In case this helps anybody else I set the IE compatibility mode for my site in IIS to 'IE=edge'. See this article for more details;

Implementing the META Switch on IIS http://msdn.microsoft.com/en-us/library/cc817572.aspx

Richard