82
rated 0 times
[
89]
[
7]
/ answers: 1 / hits: 136475
/ 10 Years ago, mon, october 13, 2014, 12:00:00
In viewmodel object, below is the property:
public IList<CollegeInformationDTO> CollegeInformationlist { get; set; }
In VIEW, javascript is as follow:
var obj = JSON.stringify('@Model.CollegeInformationlist');
alert(obj[1].State); //NOT WORKING, giving string char
$.each('@Model.CollegeInformationlist', function (i, item) {
var obj = JSON.stringify(item);
var r = $.parseJSON(obj);
alert(r.State); //just giving undefined.
});
Please guide here, how i can get JSON object in javascript.
More From » asp.net