C# 在iframe中未加载aspx页面单击按钮 受保护的无效btn_单击(对象发送方,事件参数e) { iframePatientRegistration.Attributes[“src”]=“Patient_Registration.aspx?flowType=“+flowType+”&fromTime=“+hidFromTime.Value+”&toTime=“+hidToTime.Value+”&acqModalityID=“+hidAcqModalityID.Value+”&schLocationID=“+DDLScheduledProceduresetPlocation.SelectedValue; popupPatientRegistration.Show(); }
我必须在模式弹出扩展控件中显示aspx页面。 并通过查询字符串传递值 但ASPX页面未加载到Iframe.code behind中 当我看到html源代码,然后得到这两行C# 在iframe中未加载aspx页面单击按钮 受保护的无效btn_单击(对象发送方,事件参数e) { iframePatientRegistration.Attributes[“src”]=“Patient_Registration.aspx?flowType=“+flowType+”&fromTime=“+hidFromTime.Value+”&toTime=“+hidToTime.Value+”&acqModalityID=“+hidAcqModalityID.Value+”&schLocationID=“+DDLScheduledProceduresetPlocation.SelectedValue; popupPatientRegistration.Show(); },c#,asp.net,modalpopupextender,C#,Asp.net,Modalpopupextender,我必须在模式弹出扩展控件中显示aspx页面。 并通过查询字符串传递值 但ASPX页面未加载到Iframe.code behind中 当我看到html源代码,然后得到这两行 <asp:Button runat="server" ID="hiddenPopupPatientRegistration" Style="display: none" /> <asp:ModalPopupExtender ID="popupPatientRegistration" runat="se
<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();
}
包含Div“panelPatientRegistration”的显示属性设置为无。iframe就在其中,它永远不会被渲染。收集所有查询字符串数据并将它们保存在隐藏字段中,然后编写javascript函数,通过使用隐藏字段将值作为查询字符串传递来更改iframe的src
函数更改IFRAMSRC(src){
document.getElementById(“”).src=src;
}
我在代码中看到的问题是,您正在单击一个服务器端按钮,页面将被发回,尽管您正在更改iframe的src,但由于发回,控件将被再次创建。因此,使用上面的javascript函数调用特定页面,并使用隐藏字段传递查询字符串,以解决问题。Gayatri我已经重新选择了面板上的样式,即使页面未呈现
<HTML>
</HTML>