The issue I am having is that when I am sending an Ajax request, I am getting data, but in Array if I have to look in to the data I have to do data[0]....data[100] I want to convert this data in model so I can pass this to my MVC model or directly pass to my DevExtrem Controller
Jquery
function getPowerSpecialtyId(GirdObject) {
debugger;
debugger;
var BenchMarkId = GirdObject.data ? [GirdObject.data.BenchmarkSurveyId] : null;
if (BenchMarkId != null) {
var baseurl = window.location.protocol + "//" + window.location.host;
var geturl = baseurl + "/Service/Request/BCD?selectedSurveyId=" + BenchMarkId;
$.ajax({
contentType: 'application/json; charset=utf-8',
url: geturl,
dataType: 'json',
type: 'GET',
success: function (data) {
alert(data);
},
error: function (data) {
DevExpress.ui.dialog.alert("Couldn't fetch details try again", "Oops!");
}
});
}
else {
null;
}
null;
}
object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[
C# model
public class BDTO
{
public int BId { get; set; }
public int PId { get; set; }
public int BkSId { get; set; }
public string SName { get; set; }
}
is it away i can converst everything in Model list so i can get list like?
example List BId: a, PId:s BkSId:2 SName:3 BId: 1a, PId:1s BkSId:22 SName:23
so i can easily pass this to c# model