Garima Bansal

Garima Bansal

  • 1.1k
  • 544
  • 28.6k

target="_blank" not working with download attribute

Dec 22 2023 5:51 AM

I am using as below: 

html += '<td><a @target = "_blank"  hyperlinks=' + "/Department/ViewPDF/"  >' + "Download" + '</a></td>';

public ActionResult ViewPdf(decimal id)
        {
            Departmententity entity = new Departmententity();
            byte[] data = entity.GetnocPdf(id,deptcode, uniqid);

            return File(data, "application/pdf");
        }

when i use this pdf open in same tab.

I want to open in different tab.


Answers (1)