Hello,
is it somehow possible (in Blazor) to programatically open a url in new tab?
Best regards,
Thomas
Thanks for contacting us, @TFTomSun.
@SteveSandersonMS is this something possible with pure Blazor, or should this be achieved with JSInterop for now?
You'll need to use JS interop for this.
Just in case someone else come accross this post...
public async Task NavigateToUrlAsync(string url, bool openInNewTab)
{
if (openInNewTab)
{
await JSRuntime.Current.InvokeAsync<object>("open",url,"_blank");
}
else
{
this.UriBuilder.NavigateTo(url);
}
}
Most helpful comment
Just in case someone else come accross this post...