1
I have a system in Asp net mvc, in one of the screens is displayed several items, the select to catch them from the bank is:
Select top 20 from Produtos
As demonstrated, it displays only the first twenty products. The products are rendered within several Ivs, powered by a foreach. Something like that:
foreach(var itens in produtos){
<div class="col-md-12">
<div class="col-md-6" id="produtos">
@itens.nomeProduto
</div>
</div>
}
But I wanted to bring all the products, and display only twenty, and make a kind of pager in the footer.
The question is, after I bring all the products, how can I get the first 20, and then the next 20, and then the next 20 and so on?
Wouldn’t it be interesting to do this through your consultation, bringing 20 at a time, rather than bringing everyone and paging 20 out of 20? I think it would relieve your request and also the Handler of this data. I don’t program in Asp, just like to put the idea.
– Marcelo Aymone
The idea is the same. The next button should reload products calling the function and passing the offset to stay
TOP 20 OFFSET 20
will bring from 21 to 40– Caputo
Uses the Datatable - Table plug-in for jQuery
– user13219