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

Blazor 9: Mudblazor 404 error when navigation to new page

$
0
0

I have created a new page by creating a new componenet and adding a @page /testpage directive but when I click on a link, I get page not found.

enter image description here

Navigation component

<div class="topnav" id="myTopnav"><MudLink Href="/" Underline="Underline.None" Color="Color.Dark" Typo="Typo.h5" class="active">Multiple Solutions</MudLink><MudLink Href="/counter" Underline="Underline.None" Color="Color.Dark" Typo="Typo.h6">Privacy</MudLink><MudLink Href="/weather" Underline="Underline.None" Color="Color.Dark" Typo="Typo.h6">About Us</MudLink><MudLink Href="/testpage" Underline="Underline.None" Color="Color.Dark" Typo="Typo.h6">Test Us</MudLink><MudSpacer></MudSpacer><a href="javascript:void(0);" class="icon" onclick="myFunction()"><i class="fa fa-bars"></i></a>

Error I get

enter image description here

Default pages for example /counter and /weather are working as expected.Rendering more is InteractiveServerRenderMode

Program.cs has

using BlazorApp1.Server.Components;using MudBlazor.Services;var builder = WebApplication.CreateBuilder(args);// Add services to the container.builder.Services.AddRazorComponents().AddInteractiveServerComponents();builder.Services.AddMudServices();var app = builder.Build();// Configure the HTTP request pipeline.if (!app.Environment.IsDevelopment()){app.UseExceptionHandler("/Error", createScopeForErrors: true);// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts();}app.UseHttpsRedirection();app.UseStaticFiles();app.UseAntiforgery();app.MapRazorComponents<App>().AddInteractiveServerRenderMode();app.Run();

Viewing all articles
Browse latest Browse all 4839

Trending Articles



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