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

Blazor: Create root path with parameter

$
0
0

New blazor dev here ✌️

I am trying to build a simple profile page on the root of my domain. Something similar to instagram.com/nike but mydomain.com/nike

I have a default blazor project after running dotnet new blazor with small modifications. I removed default counter and home pages and removed navbar item. Only have few files.

The Index.razor

@page "/{Username}"<h1>@Username</h1>@code {    [Parameter]    public string? Username { get; set; }}

The Index.razor.css

h1 {    color: red;}

My problem is that when I have this setup, the css in the whole project breaks...

If I change my path to something like

@page "user/{Username}"

Everything works perfectly. So I guess it's something with project not being able to build properly. Any ideas?

Project setup:

enter image description here

Console errors:enter image description here


Viewing all articles
Browse latest Browse all 4269

Trending Articles



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