views:

1263

answers:

3

I am trying to embed multiple external websites into one web page. Using an IFRAME works ok, but once you get past 10 embedded iframes, the memory fottprint starts to get too big.

So I was thinking, is it possible via ajax/javascript, to re-use the same iframe to load the collection of websites one after enother, and display the results in a div on the main webpage? Or is this explicitly blocked for security reasons?

EDIT: I don't want to go the screen scraping route, as I was planning to make this a semi public site, and I don't want to incur all the bandwidth on my server and would rather have that done on the client, if it is possible.

A: 

You are trying to use a hammer to put screws in the wall. Maybe some will go, but it won't be pretty. Your best option would be either a screen scraper or web services in order to retrieve the data from the external sites. Perhaps include more details about the situation such as, are the external sites your own. Do they offer syndication of their content that you are after. Are offline services available to you so you can consume this content?

Ty
+1  A: 

I agree with Ty about going in the screen scraping direction. You could use the weblient object - it has a DownloadString() method which gets a string of HTML from a specific url.

Lea Cohen
A: 

If you are concerned about bandwidth on your server, could you do the screen scraping (basically pull down the html through an http request) and then store that in the .net cache? Even if you stored the html for each site in the cache for 15 minutes, you would only be pulling that information down 4 times an hour. You would still have to push that html down to the client, but you could at least compress it with gzip before sending it down.

Austin