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

Blazor Server failing with unexpected query parameters

$
0
0

I have a Blazor web app with an index page at the route "/".

When accessed through myhost/myapp everything works fine. However, I published the url in a Facebook post and when users tap that link FB appends a query parameter called fbclid - making the Blazor app fail.

The error message I get in the web server logs is "The URI 'http://myhost/myapp?fbclid=[...]' is not contained by the base URI 'http://myhost/myapp/'."

My Blazor page was like this:

@page "/"<PageTitle>Index</PageTitle><h1>Welcome!</h1>

To handle the issue, I tried adding a query argument like this:

@page "/"<PageTitle>Index</PageTitle><h1>Welcome!</h1>@code {    [Parameter]    [SupplyParameterFromQuery(Name = "fbclid")]    public string FacebookClientId { get; set; }}

... but the error remains.

What should I do differently?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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