Click here to Skip to main content
15,891,788 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I am currently using Ajax to post data to a web service in vb.net

My code runs all well up until the the success function(r)

I need to post data to the webservice and return another value
Please could you assist

here is my code for the ajax

C#
var selectedFields = ($('#result').val());
            var Qid = '<%=Session("Qid")%>';
            var DrawnName= document.getElementById('<%=DrawnName.ClientID%>').value;
 var Uid = document.getElementById('<%=HiddenField1.ClientID%>').value;


SQL
$.ajax({

               url: 'Drawn.aspx/SelectedPoints',
               data: "{ 'selectedFields': '" + selectedFields + "','Qid':'" + Qid + "','DrawnName':'" + DrawnName + "','Uid':'" + Uid + "'}",
               dataType: "json",
               type: 'POST',
               contentType: 'application/json; charset=utf-8',



               success: function (r) {
                   //debugger;
                   alert(r.d.val);
                   var RID = r.d.value
                   alert(RID)
                
                   {
                   // }
               }

           });



if i firebug in firefox i can see under the response the correct value
e.g"d: 68"

how do i get that variable into a var?
Posted
Updated 29-May-15 2:00am
v2

1 solution

JavaScript
success: function (r) {
    //debugger;
    var RID = r.d;
    alert(RID)
   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900