Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have been trying this piece of code to display the PDF file into my webform. I just want to display it, not download it.:

XML
<iframe src="<a href="../DownloadForm/Form1.pdf</a>" style="z-index: 100; left: 27px; width: 671px; position: absolute; top: 130px; height: 502px"></iframe>


Error of 'Bad request' occured. What does it mean? Where should I edit the code? Please guide me..
Posted

1 solution

This HTML code is not well-formed, don't you see it?

Probably you mean
XML
<iframe src="../DownloadForm/Form1.pdf"
style="z-index: 100; left: 27px; width: 671px; position: absolute; top: 130px; height: 502px" />


There is no such thing as HTML inside attribute value.

Let me tell you that your iframe with absolute positioning looks ugly. I hope you use inline style only for the code sample — it should be in separate style sheet, separate set of files or at least in the <head> tag.

—SA
 
Share this answer
 
v3
Comments
snamyna 19-Oct-11 22:42pm    
ok, i have changed it. Thank you a lot!
After trying this code, this is for download. But how can I edit the code if i want to just viewing it in the webform?
after make some searching, I found that I can solve this problem by selecting Adobe Reader in COM component. But no Abode Reader appear in my toolbox.
Sergey Alexandrovich Kryukov 19-Oct-11 22:56pm    
No, it would be for download if you used it in anchor <a href="myfile.pdf">PDF</a>. With iframe, I just tested it with Mozilla Seamonkey and IE 8 -- they both just show PDF with Acrobat reader.
--SA

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