Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor briefly shows data then "Not found" message

$
0
0

I have a few tables in a database and on generating the basic CRUD scaffolding in Visual Studio, I was puzzled by the fact that all the pages briefly showed the data, and then the message "Not found".

I produced different versions, checked many possibilities, but all lead to the same result.

Please, also notice that it happens whether using QuickGrid or not.

Should be rendering in web assebly, but tried interactive server and interactive auto as well, for no change.

Below is my code that produces it:

@page "/clinicas"@using Atena.Data@using Atena.Models@using Microsoft.AspNetCore.Components.QuickGrid@using Microsoft.EntityFrameworkCore@implements IAsyncDisposable@inject IDbContextFactory<ApplicationDbContext> DbFactory<PageTitle>Clínicas</PageTitle><h1>Clínicas</h1><QuickGrid Class="table" Items="_context?.Clinica"><PropertyColumn Property="clinica => clinica.Email"/><PropertyColumn Property="clinica => clinica.Fantasia"/><PropertyColumn Property="clinica => clinica.Cep"/><PropertyColumn Property="clinica => clinica.Endereco"/></QuickGrid>@code {private ApplicationDbContext? _context = null!;private List<Clinica>? _clinicas;protected override async Task OnInitializedAsync(){    _context = await DbFactory.CreateDbContextAsync();    _clinicas = await _context.Clinica.ToListAsync();}   public async ValueTask DisposeAsync()   {       if (_context is not null)       {            await _context.DisposeAsync();       }   }}

Briefly,the data is shown:

Briefly data is shown

Then, a "Not found" message appears:

Then Not found message


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>