1

我已经设置 web.config 让它支持“获取”请求。

<webServices>
  <protocols>
    <add name="HttpPost"/>
    <add name="HttpGet"/>
    <add name="HttpSoap"/>
    <add name="Documentation" />
  </protocols>
</webServices>

然后,我希望网络服务只返回 json 字符串,而不是 xml!但我已经设置

[ScriptMethod(ResponseFormat = ResponseFormat.Json, XmlSerializeString = false)]

它不起作用,仍然返回带有 jsonstrings 的字符串....

我不想在页面文件中设置 contentType,就使用默认值!

4

0 回答 0