.NET-Core中 HttpContext.Response.Write() 中文输出乱码

            context.Response.ContentType = "text/plain; charset=utf-8"; -------此方法只能输出文本

 Response.WriteAsync("<script>alert('添加品牌成功!');location.href='/ProductInfos/ShowProduct';</script>", Encoding.GetEncoding("GB2312"));

 

posted @ 2019-02-21 13:51  Code麒麟  阅读(1499)  评论(0编辑  收藏  举报