Guest User

Guest User

  • Tech Writer
  • 103
  • 13.3k

Implement Pagination Using c# and Jquery.

Jun 4 2021 5:55 AM
I have Implement Pagination with c# and Jquery .This is my code
I have one query It's now static number 1,2,3 .I want to how to dynamic this number for e.g only one post display 1
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item"><a class="page-link">1</a></li>
<li class="page-item"><a class="page-link">2</a></li>
<li class="page-item"><a class="page-link">3</a></li>
</ul>
</nav>
</section>
<script type="text/javascript">
$('.pagination li a').click(function (e) {
e.preventDefault();
var id = $(this).text();
e.preventDefault();
$.ajax({
url: "/Utility/BlogPostId?Id=" + id,
type: "POST",
dataType: "html",
traditional: true,
contentType: "application/json; charset=utf-8",
success: function (data) {
$(".blog-layout-content").html("");
$(".blog-layout-content").html(data);
},
});
});
</script>

Answers (2)