在内联网与互联网上达成时,ASPX页面的呈现方式有所不同? [英] ASPX page renders differently when reached on intranet vs. internet?

查看:156
本文介绍了在内联网与互联网上达成时,ASPX页面的呈现方式有所不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这对我来说很奇怪..我在XP上运行IIS 5,它为我们的局域网托管一个小型ASP.Net应用程序,我们可以使用计算机名称,虚拟目录和页面名称进行访问( http://matt/smallapp/customers.aspx ),但您也可以点击该IIS服务器和页面互联网,因为我有一个公共IP,我的防火墙路由到马特计算机(如 http://213.202 .3.88 / smallapp / customers.aspx [只是一个虚拟的IP])。不用担心,我有Windows域身份验证,以保护应用程序免受匿名用户的侵害。

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.

所以以上所有部分都可以正常工作。但奇怪的是,当您从内部网访问页面时,页面上的div的边框会变得更厚,而不是互联网,(我使用的是IE8),还有一些div布局(拉伸等等)行为不同。为什么它会在同一个浏览器中根据是从LAN连接到互联网来呈现不同?它不会在FireFox中执行此操作。所以它必须只是一个IE8的东西。

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.

div的所有CSS都在HTML页面中,所以我不认为它是CSS的缓存问题文件。

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:

互联网: http://twitpic.com/hxx91

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

Lan: http://twitpic.com/hxxtv

推荐答案

这绝对是因为位于内部网络上的网站是用呈现的IE8默认为怪异模式,而位于Internet上的页面将根据doctype确定渲染模式。
这意味着当您通过Internet浏览页面时,该文档的doctype声明决定了渲染模式,而如果您在Intranet上浏览,则IE8使用IE7渲染引擎。

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.

可以通过用户更改IE兼容性设置,或者通过强制IE8使用IE8渲染引擎,向页面添加元标记来显式覆盖渲染模式:

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" />

这篇关于在内联网与互联网上达成时,ASPX页面的呈现方式有所不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆