This blog is useful to all my friends who are working on the .Net Technology and wants to enhance their skills as well their problem solving ability.

Thursday, August 27, 2015

mvc / mvc 5 bootstrap-paginator customized pagination

@{
    Layout = null;
}



    $(function () {
        var options = {
            totalPages: '@ViewBag.TotalPages',
            size: 'large',
            alignment: 'right',
            onPageClicked: function (e, originalEvent, type, page) {
                ObjParams.pageNumber = page;
                ;
                $.ajax({
                    url: '@Url.Action(null)',
                    type: 'POST',
                    dataType: 'json',
                    data: ObjParams,
                    success: function (response) {
                        ;
                        $("#divContainer").html('');
                        $("#divContainer").empty();
                        $("#divContainer").html(response.DataContent.Content);
                    },
                    error: function (response) {
                    }
                })
            }
        }
        $('#paginator-test').bootstrapPaginator(options);
    });

No comments: