How get data from webservice method ?

Posted by Nandkishorre under JavaScript on 8/2/2013 | Points: 10 | Views : 1035 | Status : [Member] | Replies : 2
Hi to All,
i called webservice from javascript in aspx page. This service return data. its working fine. Here my problem how to assign that return data to var or any other control using javascript. i didn't use C# code anywhere in this codeing.

I have searched many sites, which sites no one post this answer.

Could any one tell me about this.

Regard
Nanda Kishore.Ch .




Responses

Posted by: Jitendrasoft09 on: 8/3/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Kishore,

First check your web service in config file json is enabled or not as mentioned in below code-

  <webServices>

<jsonSerialization maxJsonLength="5000"/>
</webServices>


Hope you have understood.



Jitendra Kumar
If my post helps you, plz mark as an answer.

Nandkishorre, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bhupentiwari on: 8/6/2013 [Member] Starter | Points: 25

Up
0
Down
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
// url: "../Services/WebService.asmx/GetLookupValues",
url: getServiceURL() + "GetLookupValues",
data: "",
dataType: "json",
dataFilter: function (data) { return data; },
success: function (data) {
var vObj = $.parseJSON(data.d)

},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('Error In GetSingleLookupValues_Call');
}
});

in above code data is assigned to vObj variable


Thanks n Regards
Bhupendra Tiwari

Nandkishorre, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response