Answered by:
Load pdf file in a frame and show/hide div

Question
-
Hi misters,
I have a aspx page that loads PDF files into a frame (I call an ShowFile.aspx file that uses Response.BinaryWrite).
I want that the user can see div with the message loading and finished it when the PDF file have been loaded.
I have onload function for iframe but doesn't work, because never is called. Appears progress bar in IE 6.0 but not go up.
Any solution about it, please?
Thanks in advance, greetings
,<iframe src="" originalAttribute="src" originalPath="" originalAttribute="src" originalPath=""
id="iframeContenedorFicheros"
width="100%"
frameborder="1"
scrolling="auto"
onload="ficheroCargado()"
></iframe>
Javascript loads file in a frame
fichero = 'VerFichero.aspx?NOMBRE_FICHERO=' + fichero;
document.getElementById('iframeContenedorFicheros').src=fichero;
http://www.alhambra-eidos.es/web2005/index.html- Moved by Peter Ritchie Friday, June 20, 2008 3:33 PM off-topic
Wednesday, June 18, 2008 11:27 AM
Answers
-
For questions and discussions relating to ASP.NET, please see http://fourms.asp.net/
http://www.peterRitchie.com/blog- Marked as answer by Peter Ritchie Friday, June 20, 2008 3:32 PM
Friday, June 20, 2008 3:32 PMAll replies
-
When I need to do things like this, I hook into the OnReadyStateChange event. Here's some background:
http://msdn.microsoft.com/en-us/library/ms536957(VS.85).aspx
And
http://msdn.microsoft.com/en-us/library/ms534359(VS.85).aspx
Here is an example that does what I think you need (substitute your own URL):
<script language="javascript">
function ChangingIFrame( elm )
{
if ( elm.readyState == 'complete')
{
elm.style.display = 'block';
elm.nextSibling.style.display = 'none';
}
else
{
elm.style.display = 'none';
elm.nextSibling.style.display = 'block';
}
}
</script><html>
<body>
<div>
<iframe style="display:none"
onReadyStateChange="ChangingIFrame(this)"
src="http://gonewhere.info" ></iframe>
<div style="display:none; font-weight:bold;">Loading...</div>
</div>
</body>
</html>- Proposed as answer by Brett Blatchley Thursday, June 19, 2008 8:11 PM
Thursday, June 19, 2008 8:11 PM -
For questions and discussions relating to ASP.NET, please see http://fourms.asp.net/
http://www.peterRitchie.com/blog- Marked as answer by Peter Ritchie Friday, June 20, 2008 3:32 PM
Friday, June 20, 2008 3:32 PM