1

I am trying to integrate some server side pages in a Blazor Web App using Webassembly. I have a few pages in the client project, but I want some pages to run on the server. As such, I have added a page in the server project under Components/Pages. When I navigate to this page in the browser it pops up for maybe about half a second before it changes to a 404 not found.

I have tried starting from a completely new Blazor Web App using .NET 9, Interactive render mode as WebAssembly, and interactivity location as Global. I then add a test page under Component/Pages in the server project:

@page "/test"

<h3>Test</h3>

@code {

}

But when I navigate to it, https://localhost:7263/test, I get the previously mentioned experience: It quickly pops up and then rerenders as a 404 not found page. I am using Firefox.

Does anyone know what configuration I am missing or in what direction I should look?

I know this is possible, as they use a similar setup in the Individual Accounts template

2
  • 2
    Server Interactive is going to be tricky. For Static pages these answers should work. Commented Oct 2 at 20:13
  • 1
    You might check the Render Mode in the App.Razor file and set it to something like <HeadOutlet @rendermode="new InteractiveWebAssemblyRenderMode(prerender: false)" /> Commented Oct 2 at 20:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.