当前位置: 动力学知识库 > 问答 > 编程问答 >

jQuery and asp.net webservice not working

问题描述:

Im trying to call a asp.net webservice from jQuery but I get the telling me that i need to set the System.Web.Script.Services.ScriptService(). The only problem is that i have set this in the webservice and it still complains?

The jQuery uses POST and application/json and iv inlcuded HttpPost and get in my web.config. What can the problem be???

Thx for any help!

网友答案:

Decorate your method with the scriptmethod attribute:

(vb.net)

<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False, XmlSerializeString:=True)> _
Public Function SomeMethod() As String       


End Function
分享给朋友:
您可能感兴趣的文章:
随机阅读: