Finding the size of a document in a IFrame

Discussion in 'ASP .Net' started by =?Utf-8?B?TWljaGFlbA==?=, Apr 28, 2004.

  1. 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
    =?Utf-8?B?TWljaGFlbA==?=, Apr 28, 2004
    #1
    1. Advertising

  2. 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
    =?Utf-8?B?YXZucmFv?=, Apr 28, 2004
    #2
    1. Advertising

  3. 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
    =?Utf-8?B?TWljaGFlbA==?=, Apr 28, 2004
    #3
  4. 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.
    =?Utf-8?B?YXZucmFv?=, Apr 28, 2004
    #4
  5. 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
    =?Utf-8?B?VGFtbXk=?=, May 14, 2004
    #5
  6. =?Utf-8?B?TWljaGFlbA==?=

    Marina Guest

    First off, you should look up the IFRAME element, which is completely
    documented:
    http://msdn.microsoft.com/library/d...hop/author/dhtml/reference/objects/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" <> wrote in message
    news:...
    > 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
    Marina, May 14, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Carrow
    Replies:
    0
    Views:
    540
    Steve Carrow
    Jul 28, 2003
  2. Steve Carrow
    Replies:
    0
    Views:
    617
    Steve Carrow
    Jul 28, 2003
  3. Replies:
    0
    Views:
    490
  4. Daedalous
    Replies:
    3
    Views:
    666
    Daedalous
    Jan 16, 2004
  5. Joe Attardi
    Replies:
    0
    Views:
    496
    Joe Attardi
    Jan 17, 2006
Loading...

Share This Page