C
C#5mo ago
TerryDev

MudBlazor Generic Server Side Table Issues

Hello all, I am attempting to make a more "generic" MudTable on Blazor Server, as I use them frequently across my application. I made one for "client side" data, which works just fine. I am now trying to make one for server side data. My code somewhat works, as the data loads perfectly fine and changing the records per page also works perfectly fine. My issue is with changing the page on my paginator. I'm not sure what exactly is going on, but hooking up a debugger to my PageChanged function on my Paging.razor component shows that the function gets called twice, back to back. One to change the page to the one I clicked on, and another which sets selectedPage back to 1. I cannot figure out why it's getting called twice, and why it keeps getting reset back to one every single time. Any help is very much appreciated. Here's my code: https://gist.github.com/msuddaby/6ed764807ae386060a3b0c662c34a941
Gist
Server Table
Server Table. GitHub Gist: instantly share code, notes, and snippets.
3 Replies
Anu6is
Anu6is5mo ago
it's possible that the double call is due to pre-rendering (that's just speculation though) try setting prerender to false and see if it helps
TerryDev
TerryDev5mo ago
I forgot to mention, this is running .NET 7
Anu6is
Anu6is5mo ago
ah