473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

open pdf within iframe in contentplaceholder

40
im working with asp.net 2.0 and im using master pages.i have a link to a pdf file...when i click on the link i want the pdf to open within the contentplaceholder.im using iframe within the content placeholder.my master page code is below:

Expand|Select|Wrap|Line Numbers
  1. <%@ Master Language="C#" AutoEventWireup="true" CodeFile="jm.master.cs" Inherits="jm" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.     <title>Prison Department, Goa</title>
  7.     <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
  8.  
  9.     <script language="JavaScript" type="text/javascript">
  10.             var newBg;
  11.             function changeHl(strId)
  12.             {
  13.                newBg = "images/HlImg/"+strId+".jpg";
  14.                document.getElementById("imgHL").src = newBg;          
  15.             }
  16.     </script>
  17.  
  18. </head>
  19. <body>
  20.     <form id="mst" runat="server">
  21.  
  22.         <div id="wrapper">
  23.             <div id="header">
  24.                 <div style="color: #FFFFFF; font-family: 'Maiandra GD', 'Trebuchet MS', Tahoma, Verdana;">
  25.                     <table id="tbl" width="100%">
  26.                         <tr>
  27.                             <td align="center" style="width: 145px">
  28.                                 <img src="images/bg_charity1.jpg" alt="gov" style="width: 76px; height: 84px" /></td>
  29.                             <td>
  30.                                 <div style="font-size: 24px;">
  31.                                     Inspector General of Prisons</div>
  32.                                 <div style="font-size: 16px;">
  33.                                     Government of Goa</div>
  34.                             </td>
  35.                         </tr>
  36.                     </table>
  37.                 </div>
  38.                 <div id="navlist">
  39.                     <ul id="Ul1">
  40.                         <li><a id="hm" href="index.html">Home</a></li>
  41.                         <li><a id="au" runat="server" href="AboutUs.aspx">About Us</a></li>
  42.                         <li><a id="am" runat="server" href="Amenities.aspx">Amenities</a></li>
  43.                         <li><a id="ne" runat="server" href="newsandevents.aspx">News & Events</a></li>
  44.                         <li><a id="pr" runat="server" href="jailproducts.aspx">Products</a></li>
  45.                         <li><a id="rti" runat="server" href="rghtoinfrmtn.aspx">R. T. I.</a></li>
  46.                         <li><a id="cc" runat="server" href="remission.aspx">Remission</a></li>
  47.                         <li><a id="fb" runat="server" href="Default2.aspx">Feedback</a></li>
  48.                         <li><a id="cu" runat="server" href="contact.aspx">Contact Us</a></li>
  49.                     </ul>
  50.                 </div>
  51.             </div>
  52.             <div id="headline">
  53.                 <div id="photo">
  54.                     <div>
  55.                         <img src="images/igp.gif" width="618" height="250" alt="Pic 1" />
  56.                     </div>
  57.                 </div>
  58.                 <div id="search-news" style="height: 248px">
  59.  
  60.                     <h2 class="downcast">
  61.                         Quick Links</h2><br />
  62.                     <div id="plussbullets">
  63.                         <ul>
  64.                             <li><a href="stats.aspx">
  65.                                 Prison Statistics</a></li>
  66.                             <li><a href="rightsandduties.aspx">
  67.                                 Rights & Duties of Prisoners</a></li>
  68.                             <li><a href="reformation.aspx">
  69.                                 Jail Reformation</a></li>
  70.                                 <li><a href="Citizen_new.pdf" target="myspot"> 
  71.                                 Citizen's Charter</a></li>
  72.                             <li><a href="listaddoff.aspx">
  73.                                 List of area wise offices and Judicial Lock-Ups</a></li>
  74.                             <li><a href="orgchart.aspx">
  75.                                 Organisational Setup</a></li>
  76.                         </ul>
  77.                     </div>
  78.                 </div>
  79.                 <div class="clear">
  80.                 </div>
  81.             </div>
  82.             <div id="body">
  83.                 <asp:ContentPlaceHolder ID="cplMain" runat="server">
  84.                 <iframe runat="server" id="myspot" name="myspot" width="75%" height="200">
  85. Sorry, your browser doesn't support iframes.
  86. </iframe> 
  87.  
  88.                 </asp:ContentPlaceHolder>
  89.                 &nbsp;</div>
  90.             <div class="clear">
  91.             </div>
  92.         </div>
  93.         <div id="footer">
  94.             <p>
  95.                 &copy; 2009 all rights reserved.</p>
  96.             <p>
  97.                 Developed &amp; Maintained by Goa Electronics Limited
  98.             </p>
  99.             <p>
  100.                 www.goaelectronics.co.in</p>
  101.  
  102.         </div>
  103.     </form>
  104.  
  105. </body>
  106. </html>
  107.  
  108.  

i want the citizen_chart.pdf to open within the iframe....the other links open in the content placeholder.each of the other pages reference the master page,so all the links are seen in every page.so whenever i click on the citizen charter lik the pdf should open in the iframe within the contentplaceholder....any idea how i can do it...plz help
Apr 26 '10 #1
3 6653
jhardman
3,406 Expert 2GB
accidentally posted in the ASP classic forum. Moved thread to the ASP.NET forum
Apr 28 '10 #2
Frinavale
9,735 Expert Mod 8TB
You need to add some JavaScript to do this.

During the JavaScript onclick event for the link you will set the "src" attribute of the iframe element to the URL of the pdf file that you want to display.

-Frinny
Apr 28 '10 #3
semomaniz
210 Expert 100+
A little google shall answer your question. There are lots and lots of example how to open a pdf within a frame .

http://lmgtfy.com/?q=embedd+pdf+in+asp.net
Apr 28 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ian | last post by:
I'm sure there's a really simple way to do this but I'm not really familar with javascript so a bit of help would be much appreciated. What I have currently is a php program which takes in a...
4
by: Nad | last post by:
Hello, When I click on a linkbutton of a datagrid on a web form I open another web form on the same page within an iframe. The page within the iframe has a datagrid also and when I click on a...
0
by: Brent.Lakatos | last post by:
ASP.NET 2.0 Question: I have a simple IFrame User Control that I wrote: HTML: <%@ Control Language="C#" AutoEventWireup="true" CodeFile="IFrameControl.ascx.cs" Inherits="IFrameControl" %> ...
18
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
2
by: Andrew Robinson | last post by:
I would like to use a ContentPlaceHolder within the following. Any ideas on how to best accomplish this? <td rowspan="2" style="width: 600px; background-image: url('<asp:ContentPlaceHolder...
2
by: Mike | last post by:
All: I am a newbee to ASP.NET I have created an aspx webpage for the title bar which I want to use in other pages in the website.When I use an iframe in webpages to use the title bar, I get an...
2
by: news.sbcglobal.net | last post by:
Back in the good old days (or bad old days depending on your point of view) when I used frames to develop some of my web sites, I was able to designate which frame I wanted a page to open in. Now...
2
by: Shailesh Patel | last post by:
Hi, I like to target link clicked on one contentplaceholder to another contentplaceholder within one masterpage. Any suggestion? Please let me know. Thank you in advance. Shailesh
7
by: Peter | last post by:
I have the following code which is executed from a modal web page - it works fine on most, but on some computers the Word loads into memory but never displays. This occurs with IE6 and IE7, but...
10
by: AC | last post by:
I had a page that does some event setup on window.onload: function prepEvents() { document.getElementById("menumap_sales").onmouseover = swapMenuSales; // etc } window.onload = prepEvents;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.