Search section of JQuery Datatable shows on all pages in Blazor Server App.

Ronald Rex
571
Reputation points
The problem I'm facing is when I change page from page with JQuery Datatable to another page, I still have the search bar at top and pagination bar at bottom from the Datatable on the newly displayed Page. When I refresh page it goes away. Do I need some Javascript function to dispose of DataTable in the DOM? Where do you put javascript code in a Blazor Server App? Thanks !!!!
{count} votes
Do you see how the header and footer are showing at the top of this Razor Page from a previous Datatable ?
Yes, I can see two
Search bar
andshow xx entries
in your razor page, So when you refresh the page, TheSearch bar
andshow xx entries
above is gone? Please provide the relevant code for us to test.Razor Page
protected override async Task OnAfterRenderAsync(bool firstRender)
{
_Layout.cshtml
<script>
Sorry, The code can't help me to solve the issue, You can create a minimal simple project with the same issue and upload it to github then provide the link.
I think its just a matter of the Datatable not being disposed of or removed from the DOM. I am just trying to figure out how this is resolved. Thanks !!!
Sign in to comment