In Blazor Server App, getting 404 error on page refresh

Mrbanad 25 Reputation points
2024-03-11T06:57:18.34+00:00

I am working on a Blazor server app with ASP.NET Core MVC and MudBlazor for design. My panel pages are in a PanelProject.

I face the following issues:

  1. Whenever I try to refresh a page, I get a 404 error.
  2. Sometimes, I get a 403 error without knowing why.
  3. On encountering an exception, the Blazor app stops working, and I have to refresh the page.

Can someone help me find a solution?

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,379 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mrbanad 25 Reputation points
    2024-03-25T05:21:04.8466667+00:00

    problem is I have an attribute In the Root Folder Of My AdminPanel and one in the Child Folder for Example

    Root:

    @attribute [Authorize(Roles = "Administrator, System")]
    

    Child:

    @attribute [Authorize(Roles = "Branch")]
    

    I just changed my

    @attribute [Authorize(Roles = "Branch")]
    

    to

    @attribute [Authorize(Roles = "Administrator, System, Branch")]
    
    1 person found this answer helpful.
    0 comments No comments