Marthin
Marthin

Reputation: 1

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!

Upvotes: 0

Views: 196

Answers (1)

ScottE
ScottE

Reputation: 21630

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

Upvotes: 2

Related Questions