views:

1392

answers:

3

Hello,

I have a htm file with an iframe and a menu structure. The menu can load a htm file in the iframe or a aspx file. No problem at all.

But... Now they want the iframe to get the size of its content. (so there will be no scrollbar in de iframe, but you have to scroll the whole htm file)

I didn't get this to work so I thought I would use a div for this issue. But I can't get an aspx file to load in a div.

So I'm stuck. Or I have to find a way to let my iframe grow or I have to find a way to load an aspx file in a div.

Any ideas?

With kind regards, JSMB

A: 

Placing the remote content directly in a div will be the easiest here, otherwise you will have to try and automatically size the iframe after the page loads, and it might even change height after that too.

To load HTML content from a remote source into a div you will need to look at the XML HTTP Objects exposed to the browser via javascript.

It sounds like you are not familiar with the concept so I would advise using a Javascript library like jQuery to help you along.

ozone
+1  A: 

Here's an article regarding how to do this using jQuery. The article's for DotNetNuke but the premise is the same.

http://jbscdev.blogspot.com/2007/08/automatic-iframe-height-sizing-using.html

Town
A: 

The article did the trick. Thanks!