Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9302597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:17:37+00:00 2026-06-18T23:17:37+00:00

I have an iframe in aspx page: <iframe style=width: 100%; src= scrolling=auto id=reportFrame runat=server>

  • 0

I have an iframe in aspx page:

<iframe style="width: 100%;" src="" scrolling="auto" id="reportFrame" runat="server">
                                            </iframe>

And JavaScript I am using is below”

 <script type="text/javascript">
function getElement(aID) {
    return (document.getElementById) ? document.getElementById(aID) : document.all[aID];
}

function getIFrameDocument(aID) {
    var rv = null;
    var frame = getElement(aID); 
    // if contentDocument exists, W3C compliant(e.g.Mozilla)
    if (frame.contentDocument)
        rv = frame.contentDocument;
    else // bad Internet Explorer  ;)
        rv = document.frames[aID].document;
    return rv;
}

function adjustMyFrameHeight() {
    var frame = getElement("reportFrame");
    var frameDoc = getIFrameDocument("reportFrame");
    alert(frameDoc);
    frame.height = frameDoc.body.offsetHeight + 15;
        }

</script>

But I have a case for the src in my .cs page as we retrieve src from query string so the code is:

  case "Case1":
                reportFrame.Attributes["src"] = "acd.aspx";
                reportFrame.Attributes["height"] = "355px"; //giving iframe height as script now working.

In page load:

 this.reportFrame.Attributes.Add("onload", "adjustMyFrameHeight();");

I have specified the script in the page load as well as since we are using runat=”server” but still script is now working.
Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:17:38+00:00Added an answer on June 18, 2026 at 11:17 pm

    I just got an answer after debugging the script step by step that in order to get the Id of the frame, I must specify the whole or complete Id as it was inherited in a Content placeholder of the Master page so whole Id had to be given.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that is basically this: <div id=thelist style=height:100%; width:100%></div> <script type=text/javascript>
I have iframe that works at the server side : <iframe frameborder=0 runat=server style=width:
I have an aspx page with an iFrame. The iFrame's src is set to
I have an ASPX page which has an iFrame in it the source of
I have an ASPX page that is sometimes loaded into an iFrame in my
i have an aspx page containing following code <body> <script language=javascript type=text/javascript> function Hidee()
In CRM2011 I have an IFrame that displays a custom ASPX page (a photo
I have an iFrame which has it's source set to another aspx page. The
I have an aspx page containing an iFrame in it. The iFrame loads a
I have an iframe on a page called Test.aspx that points to a url

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.