views:

359

answers:

1

I put in the iframe tag as follows in my .aspx page -

Now what code do i put in javascript or vb.net to make this auto resizable depending on the size of the page that comes in?

A: 

From Matt Cutts

window.onload = function(){

  var child = document.getElementById('child-iframe-id');
  child.style.height = child.contentWindow.document.body.scrollHeight + 'px';

}

NOTE: If your child content window comes from a different domain as the parent, this likely won't work correctly, or reliably.

Tracker1