StringBuilder resultHtml = new StringBuilder();
resultHtml.Append("<span>你好啊!</span>");
HttpContext.Current.Response.ContentType = "application/ms-word;charset=GB2312"; 
HttpContext.Current.Response.Write(ResultHtml.ToString());
?
 $.ajax({
                type: "POST",
                url: url,
                data: data,
                dataType: "html",
                beforeSend: function (XMLHttpRequest) {
                    $("#divlist").html("正在加载数据");
                },
                success: function (msg) {
                    $("#divlist").html(msg);
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function (e, x) {
                }
            })
?
Ajax + StringBuilder 输出Html页面的乱码问题。

?
通过嗅探,发现post过去的时候已经加上了编码,但是还是乱码了。
个人分析,应该是返回HTML代码的时候,编码错了。
加上这句就可以编码好了
类型编码
HttpContext.Current.Response.ContentType = "application/ms-word;charset=GB2312";
?
