title: Stream PDF to browser?
body: <p>Could anyone please tell me how could I stream a pdf to a new tab browser? I just have the pdf stream on memory and I want when I click over the link to show the PDF in a new tab or window browser.
  How could I do that?
  Thank!!!</p>
  
  <p>I have this link:</p>
  
  <pre><code>&lt;a id="hrefPdf" runat="server" href="#" target="_blank"&gt;&lt;asp:Literal ID="PdfName" runat="server"&gt;&lt;/asp:Literal&gt;&lt;/a&gt;
  </code></pre>
  
  <p>In my code behind I have this on the onload event:</p>
  
  <pre><code>                Stream pdf= getPdf
                  if (pdf != null)
                  {
                      SetLinkPDF(pdf);
                  }
  
      private void SetLinkPDF(IFile pdf)
      {
          hrefPdf.href = "MyPDF to the Browser"
          PdfName.Text = pdf.PdfName;      
      }
  </code></pre>
  
  <p>Someway I have to process the stream pdf (IFile  contains Name, Stream,Metadata, etc of the PDF)</p>
  
  <p>What can I do to proccess this and whe I click show the stream at a new browser?</p>
  
  <p>I have another probelm, is not working the OnClientClick="aspnetForm.target='_blank';" timbck2 suggested me. I have to open the file (image or pdf ) in a new window, what could I do? Is not working this. Thank!</p>
  
  <p>Timbbck2 my asp code is:</p>
  
  <pre><code>&lt;asp:LinkButton runat="server" ID="LinkButtonFile" OnClick="LinkButtonFile_Click" OnClientClick="aspnetForm.target = '_blank';"&gt;&lt;/asp:LinkButton&gt;
  </code></pre>
  
  <p>Thanks!!!</p>