2012-09-18 110 views
0

使用asp.net頁面與母版頁和收到錯誤:字符編碼錯誤

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature

如果母版頁不適用的內容頁面上,然後頁面正常工作。 請爲此問題提供一些解決方案。

+1

可以粘貼一些代碼? ??? –

回答

2

檢查:How to: Select an Encoding for ASP.NET Web Page Globalization

你需要指定編碼的所有頁面這樣

<configuration> 
    <system.web> 
    <globalization 
     fileEncoding="utf-8" 
     requestEncoding="utf-8" 
     responseEncoding="utf-8" 
     culture="en-US" 
     uiCulture="de-DE" 
    /> 
    </system.web> 
</configuration> 

的頁面

<%@ Page RequestEncoding="utf-8" ResponseEncoding="utf-8" %>