在web.config文件中设置:(将utf-8改成gb2312)
<!-- 全球化
此节设置应用程序的全球化设置。 -->
<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>
<!-- 全球化
此节设置应用程序的全球化设置。 -->
<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>
String MyURL;
MyURL = "http://www.contoso.com/articles.aspx?title =为什么";Response.Write( "<A HREF = " + Server.UrlEncode(MyURL) + "> ASP.NET Examples <br>" );
// client
// javascript
// JScript source code
function OpenWindow(url,name,height,width)
{
var newURL = encodeURI(url); //client change
window.open(newURL,name,"left=100,top=100,height=" + height + ",menubar =no,resizable=no,scrollbars=no,status =no,titlebar =no,toolbar=no,width=" + width);
}