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

Issue with InteractiveServer in web app mixing Blazor, Razor and MVC pages in web app

$
0
0

I have .net 9 web app mixing Blazor, Razor and MVC pages. When I use URL with two segments, the InteractiveServer is not working.

Following code displays: Server | true

@page "/blazor"@rendermode InteractiveServer<h3>TestPage</h3>@RendererInfo.Name | @RendererInfo.IsInteractive@code {}

But when I change the page directive to:

@page "/blazor/test"[the rest the same]

It displays: Static | false.

I suppose some routing conflicts but have not found any solution for it. Any hints?

This is part of my Program.cs

app.MapRazorComponents<App>()    .AddInteractiveServerRenderMode();app.MapControllerRoute(   name: "default",   pattern: "{controller=Start}/{action=Index}");app.MapControllers();app.MapRazorPages();

And this is just basic router in App.razor:

<Router AppAssembly="@typeof(Program).Assembly"><Found Context="routeData"><AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" /></Found><NotFound><p>Not found.</p></NotFound></Router>

Just in case also folder structure:

Program.csComponents App.razor _Imports.razor Pages  Test   TestPage.razor

Viewing all articles
Browse latest Browse all 4839

Trending Articles



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