Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB ASP.NET PDF
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.:
 
<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 19-Oct-11 17:04pm
snamyna1.2K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This HTML code is not well-formed, don't you see it?
 
Probably you mean
<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
  Permalink  
v3
Comments
snamyna at 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.
SAKryukov at 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)

  Print Answers RSS
0 Mathew Soji 330
1 BillWoodruff 260
2 Sergey Alexandrovich Kryukov 240
3 OriginalGriff 216
4 Afzaal Ahmad Zeeshan 208
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,028
3 Manas Bhardwaj 4,539
4 Maciej Los 3,845


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 19 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100