Click here to Skip to main content
15,797,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<iframe id="pdfiframe" runat="server" height="400px" width="800px"></iframe>

pdfiframe.Attributes.Add("src", urlpath);

its working fine in ie showing image but not working in chrome anf firefox plz help me out


Instead of an iframe to show a PDF file (I assume that you want to show a PDF file because the ID of the iframe is "pdfiframe"), you can also use PDF.JS to render PDF files:[^]
Share this answer
Member 10057465 27-Aug-13 5:59am    
Can u please Explain me in more Detailed way thankyou.
Thomas Daniels 27-Aug-13 6:40am    
Have a look here for explanation on using PDF.JS:
Don't consider this the best approach, but, it will work nice. If you are focusing on Pdf files, use the other answer.
string s = "<SCRIPT LANGUAGE=\"JavaScript\">document.getElementById('pdfiframe').src = {0};<SCRIPT>";
System.Web.HttpContext.Current.Response.Write(string.Format(s, urlpath));
Share this answer
Member 10057465 27-Aug-13 5:57am    
I want to show both pdf and png and .gif files but not working in google chrome and firefox browser
need some more help please.........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900