I don't know why that success doesn't work. I even saw later someone having same code and it worked.
function doButtonUpdate(buttonNumber) {
$.ajax({
dataType: "json",
method: "POST",
url: '/Button/ShowOneButton',
data: {
"buttonNumber":buttonNumber
},
success: function (data) {
console.log(data);
$("#" + buttonNumber).html(data);
}
})
}
In the dataType parameter you specify "json", which means this is the type of data you are expecting to receive from the server.
But since you are directly inserting received data into the HTML, I suspect you are not receiving a valid json response (maybe HTML or just plain text?). Hence the success callback is not executed. Try leaving out this parameter, which should then fall back to an "intelligent guess" for the received data type.