title: How to display pdf file in aspx page using asp.net control?
body: <p>I need to display pdf file inside aspx page (using asp.net control) on-click of button. </p>
  
  <p>I have currently executed the below code which is displaying pdf file in Web Browser. </p>
  
  <pre><code>string folderPath = 
      Server.MapPath(ConfigurationManager.AppSettings["serverFolderPath"].ToString());
  foreach (string file in Directory.GetFiles(folderPath))
  {
      WebClient user = new WebClient();
      Byte[] fileBuffer = user.DownloadData(file);
  
      if (fileBuffer != null)
      {
          Response.ContentType = "application/pdf";
          Response.AddHeader("content-length", fileBuffer.Length.ToString());
          sponse.BinaryWrite(fileBuffer);
      }
  }  
  </code></pre>