我正在使用 ModalPopupextender Ajax 控件在模态弹出窗口中打开 aspx 页面。aspx 页面在 iframe 中打开,如下面的代码所示。在 iframe 中加载的内容是动态的,因此我无法为 iframe 提供固定高度。我希望每次打开弹出窗口时我都应该能够根据内容调整高度。我有一个调整 iframe 高度大小的功能,我在我的其他页面上成功使用了该功能,其中 iframe 在窗口本身中填充,但在弹出窗口中打开 iframe 时无法调整高度。我已经尝试过window onload、iframe onload 事件,但都没有成功。
     <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>
如果有人能引导我解决这个问题,我将不胜感激。