0

I wrote controller on ASP.net, which return list of object my custom class. I receive this json, but when I try foreach it, it show me, that element undefined. How can I fix it?

 $("#Selector").change(function () {

    $.ajax({
        type: "GET",
        url: "/test",
        data: "",
        async: false,
        success: function (response) {
            console.log(response);// show -> [Object {id="1", title="title1", Name="name1"},Object {id="2", title="title2", Name="name2"},Object {id="3", title="title3", Name="name3"}]


            $.each(response, function (data) {
                console.log("======================");
                console.log("Id:" + data.id); //show data.id is undefined
                console.log("Title:" + data.title);//show data.title is undefined
                console.log("Automated Test Name:" + data.automatedTestName);//show data.automatedTestName is undefined

            });

        },
        dataType: "json"

    })
});

0 Answers0