我有以下标记:
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
<asp:ContentPlaceHolder ID="TitleContent" runat="server" />
</title>
<asp:ContentPlaceHolder ID="HeaderContent" runat="server" />
<link href="~/Content/Site.css" rel="stylesheet" type="text/css" />
<link href="~/PublicPages/LogIn.css" rel="Stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="page">
<div id="header">
.....
而这个 web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
</configSections>
<system.web>
<machineKey validation="SHA1" />
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-DE"
/>
在回发时,我在 Firefox 中收到此错误 HTML 文档的字符编码未声明。如果文档包含 US-ASCII 范围之外的字符,则文档将在某些浏览器配置中呈现乱码。页面的字符编码必须在文档中或者在传输协议中声明,并且是一个空白页面
检查 IE 中的源代码,我看到:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD>
<BODY></BODY></HTML>
那么如何防止asp.net返回带有windows-1252字符集的页面呢?