ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,618 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
<Router AppAssembly="@typeof(Admin).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainAdminLayout)">
<NotAuthorized>
@{
_navigationManager.NavigateTo("Unauthorized", true);
}
</NotAuthorized>
<Authorizing>
Loading..
</Authorizing>
</AuthorizeRouteView>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView>
<p role="alert">Sorry, there's nothing at this address</p>
</LayoutView>
</NotFound>
</Router>
When i open the app it shows my mainlayout for a little and the goes to unauthorizedpage. Is there a way to prevent this??
most likely you are using server pre-render. the pre-render render displays the app as static html. the html includes the Blazor bootstrap code, which loads the interactive instance of Blazor. Once the interactive instance loads and starts, it executes the navigate request.
you have a couple options: