Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Finding the size of a document in a IFrame

Reply
Thread Tools

Finding the size of a document in a IFrame

 
 
=?Utf-8?B?TWljaGFlbA==?=
Guest
Posts: n/a
 
      04-28-2004
Hi

I have a ASP.NET with an IFrame element that contains a another page. When this internal page loads I want the IFrame to increase in height so that all of the contents can be displayed. I've tried a number of ways, but none seem to work as they always miss the bottom 100 or so pixels. Is there any way to find the total height of the internal IFrame document? Can I get the IFrame to automatically resize itself?

Any help would be very much appreiciated as I need to find a soluton ASAP

Many Thanks

Michael
 
Reply With Quote
 
 
 
 
=?Utf-8?B?YXZucmFv?=
Guest
Posts: n/a
 
      04-28-2004
When you load the Page in IFrame, onload event of the page, you can set the height of the IFrame
setting window.top.frames("IFrameName").heigth should do

so basically, which ever page you are loading in the IFrame, it needs to be done

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWljaGFlbA==?=
Guest
Posts: n/a
 
      04-28-2004
Hi

In order to set the height of the frame I need to find the height of the document that is loaded into the frame. How can I do this

Thank you for you response

Regards

Michael
 
Reply With Quote
 
=?Utf-8?B?YXZucmFv?=
Guest
Posts: n/a
 
      04-28-2004
instead try to find the height of the form (inside the doc) and set it
since the code to set the height of IFrame is inside the page itself, you can actually hardcode the height of the page

hth
Av.
 
Reply With Quote
 
=?Utf-8?B?VGFtbXk=?=
Guest
Posts: n/a
 
      05-14-2004
I need to be able to do this as well.... however, I can't hardcode the size of anything... it all has to be dynamic. Is there a way to do that? Also, I may be taking the solution that you posted earlier too literally.... is there something I need to import to have 'window' recognized or is 'window' representative of something else? (I am new) :

window.top.frames("IFrameName").heigth
 
Reply With Quote
 
Marina
Guest
Posts: n/a
 
      05-14-2004
First off, you should look up the IFRAME element, which is completely
documented:
http://msdn.microsoft.com/library/de...cts/iframe.asp

You will notice that there is contentWindow property, which gives you access
to the window being loaded. Once you have the window object, you can get at
anything in that window.

However, due to IE security precautions, unlses the page you are loading
happens to be in your application (or maybe it's the same domain), you will
not be able to access anything useful.

"Tammy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I need to be able to do this as well.... however, I can't hardcode the

size of anything... it all has to be dynamic. Is there a way to do that?
Also, I may be taking the solution that you posted earlier too literally....
is there something I need to import to have 'window' recognized or is
'window' representative of something else? (I am new)
>
> window.top.frames("IFrameName").heigth



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Div inside an iframe - how to set height relative to the iframe's visible size? Joe Attardi Javascript 0 01-17-2006 08:01 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM
Xalan document() function finding wrong document root Steve Carrow XML 0 07-28-2003 02:28 AM
Xalan document() function finding wrong document root Steve Carrow Java 0 07-28-2003 02:28 AM
After the execution of frame.iframe.document.designMode="On" , I lost the access to iframe, it says permission denied bhaskarna@yahoo.com Javascript 0 07-17-2003 05:05 AM



Advertisments