We help IT Professionals succeed at work.

Asynchronous client script callbacks for iFrames

Last Modified: 2013-11-19
I'm have an existing ASP.NET application.
In this application i have a web page that contains an iFrame.
This iFrame displays a url link (one of many) that is stored in a text file.  i.e. the text file contains a list of many url's
for example

and on page load using StreamReader class of the .NET framework I loop through each line item of the text file. read the url and store it in a session variable. and pass the first value in the session which in this case is http://screen1.aspx to the iFrame as url to load it for the first time. Next I'm making use of a javascript postback function to reload the page and this time i'm passing the next url to the iFrame so that it now displays this url. i.e http://screen2.aspx

This works fine so far.. however i have some challenges to overcome.. namely..

1. The url to load i.e. for example:- http://screen2.aspx may takes a long time to load..
2. the url mentioned in the text file i.e. for example:- http://screen3.aspx  may not exist.
3. there may be an error in the page while loading the page. i.e. for example:- http://screen4.aspx 

So i have to come up with a different approach to do this.. this is where it gets tricky..

I need to use client callback script (i think) to do a background processing that will asynchronous load the next url i.e. http://screen2.aspx to load in a second iFrame in the background and then display it when the time comes to do so i.e. on javascript postback function without encountering problem 2 and 3 mentioned above. and if it encounters problem 2 and 3 then the background iFrame must asynchronously load the next url in line from the text file. i.e. http://screen3.aspx and so on and so forth.. So that the page displays new screens in the iFrame almost asynchronously without a need of a postback

How can i do this ???

Please help me.. any help in this direction will be greatly appreciated..
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)



Thank you for your quick reply..

But i'm not entirely convinced that the example of codeproject is what i'm lookiing for.. because what is does is.. just disables the screen till it can load the next one.. but i dont want that.. what i want is seemless loading of the next page(url) in the iframe..

Please help!!!
That is impossible to achieve, because you have not enough control of all variables included in websites (loading time, etc..)
Forced accept.

EE Admin

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.