473,396 Members | 1,775 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,396 software developers and data experts.

Problem redirecting to specific PDF page in an iframe using ASP.NET

Hi,

I need to open a different pdf file in an iframe each time the user
clicks a button. I also need to open the pdf to a specific page each
time. The pdfs in question are located on a web site/virtual
directory on a different server.

I'm using the RegisterStartupScript function to perform a redirect to
the new pdf the first time the page is loaded and each time this
button is clicked. The problem is that the pdf document only comes up
the first time the page loads, but not any time after that as long as
I'm using the #page= specifier (I get a blank area where the iframe
should be). If I remove the #page= specifier, then the new pdf gets
loaded up every time with no problem.

I'm mystified as to why the redirect works the first time the page
loads but not subsequently. I put in an alert() to check the virtual
path to the pdf each time, and verified that this was correct. Also,
if I take that path and paste it into a new browser window, the pdf
comes up just fine with the page specified.

I'm running IE 6.0 and have Adobe Acrobat 5.0 installed. The call to
RegisterStartupScript is the same when the page loads (works) and when
the button is clicked (doesn't work):

int firstPageToDisplay = pageData.StampPDF();
if(0 == firstPageToDisplay)
{
firstPageToDisplay = 1;
}

Page.RegisterStartupScript("ShowPDF", "<script
language=javascript>showPDF('" + pageData.OutFileURL + "' , '" +
firstPageToDisplay.ToString() + "')</script>");

The script code in the aspx file is as follows:

<script language="javascript">
function showPDF(pdfURL, pageno)
{
pdfURL = pdfURL + "#page=" + pageno;
window.parent.frames.item(0).location = pdfURL;
}
</script>

Could this be an issue with how the browser and the plugin interact
when a redirect is done on a particular frame during a postback as
opposed to when loading the page for the first time? Any suggestions
would be greatly appreciated.

Thanks,
Leslie
Nov 17 '05 #1
0 3797

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: paul dallaire | last post by:
HI! I need to associate a iframe pages to a specific page for my menu system. I want to be able to click on my menu system anywhere on my site and the options that is clicked will load that...
5
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's...
2
by: Mark | last post by:
I got this code from the Internet. Demo on the site works fine but downloaded version is not. I am a very new to .NET, I cannot figure this out, please help. Here is the code: ASPX code: <%@...
2
by: Ashish | last post by:
Hi All, I have a main page that contains an iframe. Depending upon tab control selection, I load several different aspx pages (from the same app) to the iframe. My parent sets data in the session...
8
by: Ashish | last post by:
Incase the problem got bogged down reposting... Hi Gregory, I think I didnt make myself much clear. The problem is: 1. I have one ASP.NET application (no classic asp) and it has a main page...
2
by: jieelee | last post by:
Hi, I am Jieun I am working on e-mail redirecting for preventing email harvesting using iframe. When clicking on email and then click on another link on the page. Then press back button, the...
2
by: purkka | last post by:
Hi I have IFRAME on a main page having a background picture (bg.gif). A page of the IFRAME does NOT have background picture, only white bgcolor. FireFox: I can see the main page's...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
1
by: shyam | last post by:
Hi, I have a probelm in Iframe that the webpage contains two links.Each link has seperate java script codings. While loading the page for first time,There is no problem.But while postback,the...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.