jQuery Ajax parsing the response data properly --

jQuery Ajax parsing the response data properly --

Hello members.

I need help on a certain jQuery data parsing thing.

I’m doing a regular jQ ajax call and executing some server side code in C# which is returning me data. The data which the server code is returning, is basically nothing but an object of a model class [which has some properties of its own] with the values assigned to the properties fetched from db. That’s all fine.
Now in the block where I am receiving the response like

success: function(data)

{

            //things need to be done here

 

 

}


I am supposed to parse the data and assign the values to some controls on my page, mostly labels. Now, there are properties like rest_nm, rest_hrs, rest_weblinks, rest_id, rest_seatingcap etcetc which are pretty self-explanatory; and resp. labels for them. The parsing of the data object is where I am stuck. Cuz no matter what I do, it gives me ‘undefined’ whereas data is being returned just right from the server side code.
Among several other things, I tried

success: function(data)

{

            $(“#lbl_weblink”).text(data.d.rest_weblink);

$(“#lbl_hrs”).text(data.d.rest_hrs);

$(“#lbl_nm”).text(data.d.rest_nm);

 

 

 … .. and so on

 

 

}

 

You can understand that rest_nm, rest_hrs, rest_id etcetc are basically the names of the props. of the object returned by server side code.

However, this doesn’t work [the jquery I used that is]. Everything is ‘undefined’. What is the exact way to do this? Any loop, parse approach needs to be adopted? Or should there be some client side mvvm object which should then have its properties assigned to the values got from the code.

Which part did I do wrong? What is the correct syntax?
Please help me. Stuck knee deep in this.

Thanks much in advance!