我已将web.config设置为支持'get'请求。
<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="HttpSoap"/>
<add name="Documentation" />
</protocols>
</webServices>
然后,我希望webservice只返回json字符串,而不是xml!但我已经设置
[ScriptMethod(ResponseFormat = ResponseFormat.Json,XmlSerializeString = false)]
它不起作用,仍然使用jsonstrings返回字符串....
我不想在页面文件中设置contentType,只需使用默认值!