如何在按钮单击事件的模态弹出扩展器中加载 iframe 中的页面?
嗨,我在页面中有一个带有链接按钮的网格(例如:“page1”),当我单击链接按钮时,我需要通过在 a 中传递查询字符串来加载页面(例如:“page2”)我在模态弹出扩展器控件中设置的 iframe。我可以通过在标记中添加这段代码来实现这一点
<asp:TemplateField HeaderText="PO NUMBER" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Center" ItemStyle-Width="100px">
<ItemTemplate>
<asp:HiddenField ID="hfPOAID" runat="server"
Value='<%# Bind("POAtID") %>'></asp:HiddenField>
<asp:LinkButton ID="lbtnPO" runat="server" ForeColor="Blue"
Text='<%# Bind("PONUM") %>' CommandName="POview" CommandArgument=
'<%# ((GridViewRow) Container).RowIndex %>' AutoPostBack="True">
</asp:LinkButton>
<cc1:ModalPopupExtender ID="mpeStatus" OnOkScript="__doPostBack('Ok','')"
runat="server" TargetControlID="lbtnPO" PopupControlID="pnlPerson" DropShadow="true"
CancelControlID="ibCancel1" > </cc1:modalpopupextender>
<asp:Panel ID="pnlPerson" runat="server" Style="display: none"
Width="900px" Height="550px" CssClass="modalPopup">
<div style="float: right;">
<asp:ImageButton ID="ibCancel1" runat="server" ImageUrl="~/Images/del.png"
Width="20px" Height="20px" />
</div>
<div>
<table>
<tr>
<td align="center" style="font-size: 14px;">
<b>View Purchase Order</b>
</td>
</tr>
<tr>
<td>
<iframe name="FRAME1" width="800" height="500" frameborder="0"
src='<%#String.Format("ShowPO.aspx?Poid={0}", Eval("POAtID"))%>'>
</iframe>
</td>
</tr>
</table>
</div>
</asp:Panel>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateField>
并在代码隐藏页面中----------------
protected void gvPOCloseRpt_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "POview")
{
int index = Int32.Parse(e.CommandArgument.ToString());
HiddenField hfPOAID = (HiddenField)gvPOCloseRpt.Rows[index].FindControl
("hfPOAID");
Session["POID"] = hfPOAID.Value;
string Script = "window.open('http://mak-erp/deverp/Purchase/poprnt.aspx')";
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this,
this.GetType(), "test", Script, true);
}
}
catch (Exception ex)
{
Response.Write(ex);
}
}
但是,如果网格中有大量数据,加载页面需要很长时间,所以,我只需要在网格中链接按钮的单击事件上加载页面吗?......
任何人都可以帮助我做到这一点......
提前致谢...........
迪内什库马尔 R,