【发布时间】:2011-06-20 12:18:22
【问题描述】:
如何在 iframe 中加载一个页面,该页面位于按钮点击事件的模态弹出扩展器中?
您好,我在页面中有一个带有链接按钮的网格(例如:“page1”),当我单击链接按钮时,我需要通过传递一个加载页面(例如:“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);
}
}
但是,如果网格中有批量数据,加载页面需要很长时间,所以,我只需要在网格中链接按钮的点击事件上加载页面吗?......
谁能帮我做这个.....
提前致谢...........
Dineshkumar R,
【问题讨论】:
标签: c# asp.net iframe linkbutton modal-popup