Page reloads after updating sqlite database

How can I avoid a complete page reload, that happens when the Datagrid gets updated (new record, updated record)? It seems, as if this happens only if I use a sqlite database file, but it works fine with MSSQL.

The problem is, that the content of the grid and various other labels on the page depends on the selected item from a dropdown list. Hence, a reload of the page results in an empty page where the item from the dropdown list has to be selected again.

Thanks for your help in advance.

Hi @dignida,

The code generated by Radzen Blazor Studio never does a full page refresh regardless of the database used. Did you have some custom implementation by any chance?

Hello korchev,

I don't recall changing anything in the code generated by RBS, except for some data types that are not correctly inferred from the database (DateTime gets changed to Long).

My suspicion about the database came when I was debugging the code, i.e. with the following:

protected async Task GridRowUpdate(ABschein.Models.ArbeitsscheinDB.DboPositionen args)
        {
            await ArbeitsscheinDBService.UpdateDboPositionen(args.Position_PK, args);
        }

Every time this gets executed the output shows the following:

dotnet watch :watch: File changed: .\wwwroot\Arbeitsschein.db.
dotnet watch :fire: Hot reload of static file succeeded.

I am not an expert on what a "Hot reload" does exactly, but it implies to me that a refresh of the page is necessary to apply the changes that were made to code, or in this case to application relevant files.

After these messages are shown in the output, the next thing that happens in the browser is a reload of the page.

Oh I see. I think the .NET hot reload restarts the application because it has detected a change in the SQLite DB file. You can try the accepted answer from this thread: .net core - How to exclude certain file types from dotnet watch run? - Stack Overflow

1 Like

I added

<Content Update="my\database\folder\**" Watch="false" />

to my csproj file in the ItemGroup section and now it works fine.

Thanks, much obliged.