Blazor authenticates a new tab and after downloading the File leaves it open

Noman Saiyed 1 Reputation point
2022-07-01T07:19:11.23+00:00

I have a Component in Blazor that has an anchor tag which opens a new tab as below:

<a href="@($"api URL in here" class="btn btn-primary @(isLoading ? " disabled" : "" )" id="btnDownload" target="_blank"><i class="fa fa-download"></i></a>

The issue I face is as I am already logged in to the application but on the new tab it authenticates me again and download the file correctly but then does not close the tab on completion of the dialog.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,395 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,275 questions
{count} votes