0
点赞
收藏
分享

微信扫一扫

用 asmx方式 ajax 请求


<system.web>
<compilation debug="true" targetFramework="4.0" />
<webServices>
<protocols>
<add name= "HttpPost"/>
<add name= "HttpGet"/>
</protocols>
</webServices>
</system.web>

必须设置 这些.
[System.Web.Script.Services.ScriptService] 这个打开
[ScriptMethod(ResponseFormat = ResponseFormat.Json)] // UseHttpGet = true (这个是 只允许GET 请求 不加的话 只允许 post请求);
//建议只用post请求就可以了 安全点

 

举报

相关推荐

0 条评论