Вам просто нужно удалить добавленное ранее «Результаты не найдены» и показать все, что дает ваш метод публикации в качестве ответа. т.е.
Создайте отдельный div внутри #tblSeeMore, который будет содержать «Результаты не найдены»
<div id="divNoResults">
</div>
и измените свой ajax вызов post на это:
$.ajax({
url: "@Url.Action("RestaurantPaging", "Home")",
type: 'POST',
data: ({ categoryparam: category, postcodeparam: postcode, nextitemparam: nextItems, isOfferparam: isofferparam}),
cache: false,
success: function (result, status, xhr) {
debugger;
if(result == "No Results Found"){
$('#divNoResults').empty();
$('#divNoResults').append(result);
}
else
$('#tblSeeMore').append(result);
//rest of the code
}
})
Или вы можете просто изменить отображение #divNoResults в зависимости от результата метода публикации
<div id="divNoResults" style="display:none">
<p>No Results Found</p>
</div>
$.ajax({
url: "@Url.Action("RestaurantPaging", "Home")",
type: 'POST',
data: ({ categoryparam: category, postcodeparam: postcode, nextitemparam: nextItems, isOfferparam: isofferparam}),
cache: false,
success: function (result, status, xhr) {
debugger;
if(result == "No Results Found"){
$('#divNoResults').show();
}
else
$('#tblSeeMore').append(result);
//rest of the code
}
})