This code will help you to understand if Blazor opens a URL in a new tab using UriHelper NavigateTo or not.
You have to use the JS interop to achieve this requirement.
public async Task NavigateToUrlAsync(string url, bool openInNewTab) { if (openInNewTab) { await JSRuntime.InvokeAsync<object>("open", url, "_blank"); } else { this.UriHelper.NavigateTo(url); } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
You have to use the JS interop to achieve this requirement.
need an explanation for this answer? contact us directly to get an explanation for this answer