Hi.
I've got a button that uses Window.MyFrame.Location = "page2.html" to display a page within a frame. Works no problem. However, as apart of the same button click, I want to print the new frame content using Window.MyFrame.Print. Unfortunately, if before my button is clicked, MyFrame is displaying "page1.html", that is the page that gets printed, THEN "page2.html" is displayed.
Is there a way to refresh the frame to get it to display "page2.html" before the print command fires? If not, is there a convenient work-around?
Thanks, Terry

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Re: Easy (?) One - Fill Frame and Print by Agoston

Agoston
Thu Dec 02 03:28:06 CST 2004


"Terry Hale" <boondocsco@aol.com> wrote in message
news:eQdSpLB2EHA.4072@TK2MSFTNGP10.phx.gbl...
> Hi.
> I've got a button that uses Window.MyFrame.Location = "page2.html" to
display a page within a frame. Works no problem. However, as apart of the
same button click, I want to print the new frame content using
Window.MyFrame.Print. Unfortunately, if before my button is clicked,
MyFrame is displaying "page1.html", that is the page that gets printed, THEN
"page2.html" is displayed.
> Is there a way to refresh the frame to get it to display "page2.html"
before the print command fires? If not, is there a convenient work-around?

Maybe you should wait until page2.html is loaded into the frame. (I.e. until
Window.MyFrame.Document.readyState = "complete")


> Thanks, Terry
>
> **********************************************************************
> Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...



Re: Easy (?) One - Fill Frame and Print by Michael

Michael
Thu Dec 02 12:08:29 CST 2004

> Maybe you should wait until page2.html is loaded into the frame.
> (I.e. until Window.MyFrame.Document.readyState = "complete")

Or for IE 5.5 or higher, use an onload event handler for the iframe.

--
Michael Harris
Microsoft MVP Scripting