如果在地址栏中键入网络名称而不是“localhost”,则相同的页面显示不同的内容。这怎么可能?

时间:2022-07-31 21:10:14

I have an ASP.NET page that shows different content if instead of "localhost" I type the network name in the address bar.

我有一个ASP。如果在地址栏中键入网络名称而不是“localhost”,则显示不同内容的NET页面。

This appears if I type localhost: 如果在地址栏中键入网络名称而不是“localhost”,则相同的页面显示不同的内容。这怎么可能?

如果我输入localhost:

This appears if I type the network name: 如果在地址栏中键入网络名称而不是“localhost”,则相同的页面显示不同的内容。这怎么可能?

如果我输入网络名,就会出现:

These are the same pages, if I add a text, the modification appears on both versions.

这些是相同的页面,如果我添加一个文本,修改将出现在两个版本中。

This happens only on IE, in chrome I always get the same correct page.

这只发生在IE上,在chrome我总是得到相同的页面。

How is this possible???

这怎么可能? ? ?

The code:

代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestNoMaster.aspx.cs" Inherits="app_Employee.TestNoMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .zzzttt222 {
            display: inline-block;
            margin-right:40px;
            border: 1px solid;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <div class="zzzttt222">element</div>
        <div class="zzzttt222">element</div>
        <div class="zzzttt222">element</div>
        <div class="zzzttt222">element</div>

    </div>
    </form>
</body>
</html>

2 个解决方案

#1


3  

Have you looked at the compatibility view settings in Tools -> Compatibility View settings? It's possible that either 'localhost' or 'hubpwwks011117' is listed as one of the websites to view in Compatibility View, which would explain the difference when rendered.

你看过工具->兼容性视图设置中的兼容性视图设置吗?有可能“localhost”或“hubpwwks011117”被列为在兼容性视图中查看的网站之一,这将解释在呈现时的差异。

#2


0  

As @larsenmc said, probably it's a compatibility view problem. IE likes to put all intranet pages in compatibility view. Maybe IE thinks that one page is intranet and another isn't, creating this difference between both pages.

正如@larsenmc所说,这可能是一个兼容性视图问题。IE喜欢将所有内部网页面放在兼容性视图中。也许IE认为一个页面是内部网,另一个不是,这就造成了两个页面之间的差异。

There is an option in IE to enable or disable compatibility view in intranet pages. Try do uncheck this.

IE中有一个选项可以在内部网页面中启用或禁用兼容性视图。尝试做取消。

#1


3  

Have you looked at the compatibility view settings in Tools -> Compatibility View settings? It's possible that either 'localhost' or 'hubpwwks011117' is listed as one of the websites to view in Compatibility View, which would explain the difference when rendered.

你看过工具->兼容性视图设置中的兼容性视图设置吗?有可能“localhost”或“hubpwwks011117”被列为在兼容性视图中查看的网站之一,这将解释在呈现时的差异。

#2


0  

As @larsenmc said, probably it's a compatibility view problem. IE likes to put all intranet pages in compatibility view. Maybe IE thinks that one page is intranet and another isn't, creating this difference between both pages.

正如@larsenmc所说,这可能是一个兼容性视图问题。IE喜欢将所有内部网页面放在兼容性视图中。也许IE认为一个页面是内部网,另一个不是,这就造成了两个页面之间的差异。

There is an option in IE to enable or disable compatibility view in intranet pages. Try do uncheck this.

IE中有一个选项可以在内部网页面中启用或禁用兼容性视图。尝试做取消。