I get model’s values from view with this codeblock and this part is OK.
var data = new FormData();
var datas = $(this).serializeArray();
for (var i = 0; i < datas.length; i++) {
data.append(datas[i].name, datas[i].value);
}
In addition I want to add a list to data variable with this code block.
commentlist.push({ CommentID: commentguid, UserName: username, Comment: comment, MainCommentID: topcommentid });
data.append("Comments", commentlist);
And this is the list in my model from controller side.
public List<CommentModalClass> Comments { get; set; }
In summary I want to send commentlist
to controllerside in data
but I couldn’t make it.
4