Good Day Everyone
I'm creating a Blazor Server Side application with card style on my home page, I did not use javascript on loading those data, it's just simple razor and c#. Now it loads almost 2000 data, this makes my app slow, so what I want to do is to load 50 data first, then there is a load more below that will load 50 data, my idea is to insert the 50 on the object where the first 50 is, but I think this will also cause a bulk on the data projected on the page, and it might cause a problem if it reaches a 3000 , is there a way to do this on the Blazor Server-Side?
Thanks and regards
CodePudding user response:
Blazor does not have built-in pagination. You'll have to do that yourself in your C# code that sends the data to your frontend/razor component(s). There are Blazor frameworks that can handle that for you, of course (Google for MudBlazor or Radzen).
CodePudding user response:
You can either create your own logic to load more results on each click of a button (not really hard to manage that with a SQL query).
Or you can try component virtualization, which I suspect is the closest built-in option to what you want:
https://docs.microsoft.com/en-us/aspnet/core/blazor/components/virtualization?view=aspnetcore-6.0