I have a project in Blazor
And on the client-side, I want to read hash parameters
I know how to do it in JavaScript - but my question is how to do it in c# client-side in Blazor project
For example, I have an URL http://localhost:5060/#token=12345678
How to take token
?
my code in index.cshtml
@page "/"
@inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper
<h1>Hello, world!</h1>
url is @Url
@functions {
protected override void OnInit() {
Url = GetUrl();
}
public string Url { get; set; }
public string GetUrl() {
return ?;
}
}