我正在转换一个脚本从PHP到ASP.net C#。在PHP中,我可以使用如下内容:
header('Content-type: text/json');
header('Content-type: application/json');
我如何告诉我的aspx页面在页眉中声明它正在打印一个JSON文件?
发布于 2009-05-21 20:05:56
Response.ContentType = "application/json";
或者更一般地说
Response.Headers.Add("Content-type", "text/json");
Response.Headers.Add("Content-type", "application/json");
https://stackoverflow.com/questions/894828
复制相似问题