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

URL parameters and stylesheets in Blazor .NET 8

$
0
0

I have a Blazor Web application project on .NET 8 with autorendering. In the client project I've created a page with page parameters like this:

Html:

@page "/"@page "/{parent?}"@page "/{parent?}/{categoryUrl?}"@page "/{parent?}/{categoryUrl?}/{url?}"@page "/{parent?}/{categoryUrl?}/{url?}/{pId?}"@page "/{parent?}/{categoryUrl?}/{url?}/{suburl?}/{pId?}"@page "/{parent?}/{categoryUrl?}/{url?}/{pId?}/{month:int?}/{year:int?}"  @rendermode InteractiveAuto

Code:

[Parameter]public string? url { get; set; }[Parameter]public string? suburl { get; set; }[Parameter]public string? parent { get; set; }[Parameter]public string? categoryUrl { get; set; }[Parameter]public string? pId { get; set; }[Parameter]public int? month { get; set; }[Parameter]public int? year { get; set; }

I then use OnParametersSetAsync() to create logic for what happens with the parameters.

The strange thing is that the auto generated stylesheet, [project].styles.css, is showing up as the parent parameter even when the url is on the baseUrl (https://localhost:7215/) and the parent parameter is empty (see attached image).

enter image description here

Why is this and how can it be fixed?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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