What's new

C# C# MVC AJAX Question

1nn0c3ntv5

Honorary Poster
Joined
Feb 10, 2020
Posts
143
Reaction
215
Points
133
Age
25
Gamit ko po ay C# MVC5 tas Dapper Micro Object Relational Mapper

Question: Paano ko ma a di-display yung lahat ng result sa alert individually at per index?

ex.
alert(value ng January) //0 -> index 0
alert(value ng February)//0 -> index 0
alert(value ng November)//5 -> index 0
alert(value ng January)//1 -> kasi nasa index 1 siya

1609926247294.png


Tuwing dinidisplay ko sila lumalabas ['Object object]

Ito po yung code ko sa Javascript ng View ko
$(document).on("change", ".YearDDL", function () { $.ajax({ type: "GET", "url": "/DataGet/GetLWStatus", dataType: "json", async: false, data: { UpdatedStatusID: 1, }, success: function (result) { $.each(result, function (index, value) { var jsonStringify = JSON.stringify(result); var jsonObj = JSON.parse(jsonStringify); console.table(jsonObj); }); } } ); });
 

Attachments

$(document).on("change", ".YearDDL", function () {
$.ajax({
type: "GET",
"url": "/DataGet/GetLWStatus",
dataType: "json",
async: false,
data: {
UpdatedStatusID: 1,
},
success: function (result) {

$.each(result, function (index, value) {
var jsonStringify = JSON.stringify(result);
var jsonObj = JSON.parse(jsonStringify);
console.table(jsonObj);
});
}
}
);
});
 

Similar threads

Back
Top