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 7870139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:31:49+00:00 2026-06-03T01:31:49+00:00

I am using a ModalPopupextender Ajax Control to open aspx page in a modal

  • 0

I am using a ModalPopupextender Ajax Control to open aspx page in a modal Popup. aspx page is opened in a iframe as shown in below code.The content which is loaded in iframe is dynamic hence I cannot give a fixed height to iframe. I want that I should be able to adjust the height as per the content every time popup is being opened. I have a function to resize the iframe height and I am using that successfully on my other pages where iframe gets populated in the window itself but not able to adjust the height when iframe is opened in a POPUP. I have already tried window onload, iframe onload events without any success.

     <asp:ModalPopupExtender ID="ModalPopupExtender2" BackgroundCssClass="transparentBG"
        runat="server" CancelControlID="ButtonCancel" OkControlID="ButtonDone" 
        TargetControlID="btnAddNew" PopupControlID="DivAddWindow" Drag="true"  >
     </asp:ModalPopupExtender>
     <div class="popup_Buttons" style="display: none">
      <input id="ButtonDone" value="Done" type="button" />
      <input id="ButtonCancel" value="Cancel" type="button" />
     </div>
     <div id="DivAddWindow" style="display: none;">

     <iframe id="IframeEdit" scrolling="no" src="MasterPage.aspx"  width="700px">
    </iframe>
   </div>

I would really appreciate if somebody can lead me the solution to resolve this.

  • 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-03T01:31:52+00:00Added an answer on June 3, 2026 at 1:31 am

    Try this:

     <iframe id="IframeEdit" onload="iframeLoaded()" scrolling="yes" src="MasterPage.aspx"  width="700px">
    </iframe>
    

    following javascript function would get height from the iframe content.

    <script type="text/javascript">
    function iframeLoaded() {
        var iFrameID = document.getElementById('IframeEdit');
    
        if (iFrameID) {
            iFrameID.height = "";
            iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
        }
    }
    </script>  
    

    I checked it in even ModalPopupextender, it works.

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

Sidebar

Related Questions

I am using the ModalPopupExtender control to display a modal popup dialog when a
I've got a modal popup (using ModalPopupExtender) working in a kind of master/detail view
I'm using the ModalPopupExtender control from the AJAX toolkit. This control extends a panel
I'm using the Ajax Control Toolkit's ModalPopupExtender. It works great but when I add
I have inherited some code using an ASP modal popup extender and for some
I'm not able to get my panel popup using ModalPopupExtender. Here's the code .modalBackground
I tried using this example: http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/modalpopup/modalpopup.aspx <ajaxToolkit:ModalPopupExtender ID=MPE runat=server TargetControlID=LinkButton1 </ajaxToolkit:ModalPopupExtender> And try using
in web applicaiton,[asp.net] i am using modal popu control, it is working fine, but
I have done a program for a pop-up using Ajax ModalPopupExtender where I will
I am using an ASP.NET ModalPopupExtender on a page and would like to prevent

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.