日期:2014-05-16  浏览次数:20886 次

asp.net中RadComboBox控件出现乱码的常见解决办法
一般存在这样两个解决方案:
1.   在web.config里面增加
    <globalization   fileencoding= "utf-8 "   requestencoding= "utf-8 "   responseencoding= "utf-8 "   culture= "zh-cn "/>

2.   在后台代码里面对乱码进行decoder操作;

上面两种都不是好的方案,第一个可能会导致其他的页面出现问题,   第二个虽然存到数据库教程中的是正确的,但是,用户看到的仍然是乱码,严重影响用户体验。那么,最好的解决方法在哪里?

  解决思路:我们可以通过对web.config文件增加   <location>   配置节来对特定文件或者目录进行encoding配置   ,如下:
    <location   path= "此处为目录或文件名 ">
            <system.web>
                <globalization   fileencoding= "utf-8 "   requestencoding= "utf-8 "   responseencoding= "utf-8 "   culture= "zh-cn "/>
            </system.web>
        </location>
来源:http://www.3ppt.com/Design/aspx/38277.html