Unable to pass data to action
function addComment() { var request = new XMLHttpRequest(); request.open('POST', "/Picture/AddComment", true); request.onreadystatechange = function(e) { if(this.readyState == 4) { if (this.status == 200) { alert(request.responseText); } } } request.send("comment=qwe"); } comment = null here
public IActionResult AddComment(string comment) { return View("Index"); }
addCommentcalled on the client? - Igor