I'm trying to make a sort with javaScript on my function I'm calling a method on the controller. That method is an actionResult, on that method my model that I'm using on the view is refreshing but I don't know how to refresh that on the view. I mean how to go to the return on the method in the Controller and stop the thread ajax. I'm trying this.
function sort(callback) {
$.ajax({
url: '@Url.Action("Method","Controller")',
type: "POST",
async:false,
data: { query: null, search: $('#QueryString').val(), sort: sortOrder, sort_value: sortValue,portfolioId:-1},
success: function (data) {
alert("sort success");
},
error: function (data) {
alert("error");
}
})
};