Mas

Mas

  • NA
  • 478
  • 70.5k

How can we merge the two web pages (doc and Pdf preview)

Jan 20 2020 12:47 PM
Hello Members,
 
Hope you are doing good,
 
Here am attaching the code for DOC, for preview the documents...
 
For Doc preview i have written one code and for PDF preview we are using Iframes..
 
I want to merge these two page, If it is PDF it need to go for Iframes and if it is doc or docx it need to go for particular code..
For PDF below is the code.
  1. <!DOCTYPE html>  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head runat="server">  
  4. <title>pdf viewer</title>  
  5. </head>  
  6. <body>  
  7. <form id="form1" runat="server">  
  8. <iframe id="myFrame" style="display:none" width="600" height="300"></iframe>  
  9. <input type="button" value="Submit" onclick = "openPdf()"/>  
  10. <script type="text/javascript">  
  11. function openPdf()  
  12. {  
  13. var omyFrame = document.getElementById("myFrame");  
  14. omyFrame.style.display="block";  
  15. omyFrame.src = "http://www.africau.edu/images/default/sample.pdf";  
  16. }  
  17. </script>  
  18. <div>  
  19. <asp:TextBox ID="searchTxt"  
  20. runat="server"  
  21. Width="300px"  
  22. Height="25px"  
  23. Font-Size="Medium"></asp:TextBox>  
  24. <input type="button" value="Search" onclick="return highlight(text) /*searchPrompt('search text', 'dvWord', false, true, 'red', 'orange')*/" />  
  25. </div>  
  26. </form>  
  27. </body>  
Can any one guide me here..
 
Thank you in advance!!

Attachment: Global.asax.zip

Answers (1)