Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Iframe Height

Iframe Height

Scheduled Pinned Locked Moved Web Development
csharpjavascripthtmlcomsysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    icanmakeiteasy
    wrote on last edited by
    #1

    Hi all, how to set Iframe height dynamically??? my html code is:

    <html>
    <head>
    <script type="text/javascript">

    function IframeHeight(frameId){
    frame = document.getElementById(frameId);
    framedoc = frame.contentWindow.document;
    frame.height = framedoc.body.scrollHeight + 10;
    }

    </script>
    </head>
    <body>

    < iframe id='myiframe' scrolling='no' width='100%' runat='server' />

    </body>

    </html>

    now from c#

    myiframe.Attributes.Add("src", "http://www.yahoo.com");
    myiframe.Attributes.Add("onload", "IframeHeight('myiframe');");

    in this way i am getting "Access denied" error message why???? if i set src as my local projects page its working fine.... htlp me frnds how to set other website url as myiframe source thanks in advance

    icanmakeiteasy

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups