0
<asp:Button runat="server" ID="hiddenPopupPatientRegistration" Style="display: none" />
    <asp:ModalPopupExtender ID="popupPatientRegistration" runat="server" PopupControlID="panelPatientRegistration"
        TargetControlID="hiddenPopupPatientRegistration" BackgroundCssClass="cssmodalbackground"
        BehaviorID="modalBehaviour" CancelControlID="btnClose">
    </asp:ModalPopupExtender>
    <div id="panelPatientRegistration" class="cssmodalpopup" style="display: none">
        <iframe id="iframePatientRegistration"  class="csstable" runat="server" width="600px"
            height="485px" scrolling="auto"></iframe>
        <table>
            <tr>
                <td align="right">
                    <asp:Button ID="btnClose" runat="server" CssClass="cssbutton" Text="Close" />
                </td>
            </tr>
        </table>
    </div>

    protected void btn_Click(object sender, EventArgs e)
    {
          iframePatientRegistration.Attributes["src"] = "Patient_Registration.aspx?flowType=" + flowType + "&fromTime=" + hidFromTime.Value + "&toTime=" + hidToTime.Value + "&acqModalityID=" + hidAcqModalityID.Value + "&schLocationID=" + ddlScheduledProcedureStepLocation.SelectedValue;
            popupPatientRegistration.Show();
    }

我必须在模式弹出扩展器控件中显示 aspx 页面。并通过查询字符串传递值,但 ASPX 页面未加载到 Iframe.code 后面。

当我看到 html 源代码然后得到这两行

<HTML>
</HTML>
4

2 回答 2

0

包含 Div“panelPatientRegistration”的显示属性设置为无。iframe 在里面,它永远不会被渲染。

于 2013-07-15T11:01:58.567 回答
0

收集所有查询字符串数据并将它们保存在隐藏字段中并编写 javascript 函数,通过使用隐藏字段将值作为查询字符串传递来更改 Iframe 的 src。

    <script>
        function changeIframSrc(src) {
            document.getElementById('<%=iframePatientRegistration.ClientID %>').src = src;
        }
    </script>

我在代码中看到的问题是您正在单击服务器端按钮,该页面正在被回发,即使您正在更改 iframe 的 src,但由于回发,控件正在重新创建。因此,使用上面的 javascript 函数调用该特定页面并使用隐藏字段传递查询字符串即可解决问题。

于 2013-07-15T11:21:56.300 回答