how to open a .pdf file in a panel or iframe using asp.net c#
<p>I am trying to open a .pdf file on a button click. I want to open a .pdf file into a panel or some iframe. With the following code i can only open .pdf file in a separate window or in a save as mode. </p>

<pre><code>string filepath = Server.MapPath("News.pdf");
    FileInfo file = new FileInfo(filepath);
    if (file.Exists)
    {
        Response.ClearContent();            
        Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name); 
        Response.AddHeader("Content-Length", file.Length.ToString());            
        Response.ContentType = ReturnExtension(file.Extension.ToLower());            
        Response.TransmitFile(file.FullName);
        Response.End();
    }
</code></pre>

<p>how to assign a iframe to the below line</p>

<pre><code>Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name); 
</code></pre>
