You can implement this using Ajax , the browser will send a message "behind the scenes", so to speak, without redirecting the user, the Server will return the data in JSON format .
On the server: create a new CommentsController and add Action Like :
[Authorize] public JsonResult Like(int id) {
In your opinion, just use jQuery Ajax methods:
function likeComment(id) { $.post('<%=Url.Action("Like", "Comments")%>/' + id, function(data){
source share