This code will help you to understand how to open a URL in a new tab programmatically.
We can make use of JS Interop to open a URL in new tab.
public async Task NavTo(string url, bool isNewTab) { if (isNewTab) { await JSRuntime.InvokeAsync<object>("open", url, "_blank"); } else { NavManager.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.
We can make use of JS Interop to open a URL in new tab.
need an explanation for this answer? contact us directly to get an explanation for this answer