3、设置响应内容类型改为json类型,效果如下
Response.ContentType
1、文本格式:html、xml、txt
Response.ContentType = “text/html “;
Response.ContentType = “text/xml”;
Response.ContentType = “text/plain”;
2、图片格式
Response.ContentType = “image/jpg”;
Response.ContentType = “image/png”;
Response.ContentType = “image/gif”;
3、媒体格式
Response.ContentType = “application/json”; //比较常用
Response.ContentType = “application/xml”;
Response.ContentType = “application/xhtml+xml”;
Response.ContentType = “application/atom+xml”;
Response.ContentType = “application/pdf”;
Response.ContentType = “application/msword”;
Response.ContentType = “application/octet-steam”;
Response.ContentType = “application/x-www-form-urlencoded”;
标签:xml,ContentType,C#,text,image,application,Response From: https://www.cnblogs.com/skynight/p/17601004.html