我试图用iframe显示一个UpdateProgress图像。但这是行不通的。我正在使用这个iframe显示几页。我的代码如下..
<iframe
runat="server" id="Iframe2" height="565" width="100%" scrolling="no"
style="overflow-x:hidden;" frameborder="0" marginheight="0" marginwidth="0"
vspace="0" hspace="0">
</iframe>
<asp:HiddenField ID="hdfIndex" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ibtnPrevious" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnNext" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnPage1" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnPage2" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnPage3" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnPage4" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="ibtnPage5" EventName="Click" />
</Triggers>
但是当我不用iframe的时候,它就能很好的工作了。
发布于 2011-08-25 08:22:26
在我看来,使用iframes的最佳方法是将iframe指向一个仅负责重定向的aspx页面:
<iframe runat="server" id="Iframe2" height="565" width="100%" scrolling="no"
style="overflow-x:hidden;" frameborder="0" marginheight="0" marginwidth="0"
vspace="0" hspace="0" src="Waiting.aspx?page=WebPageTarget.aspx">
</iframe>而且,在Wating.aspx.cs中:
protected void Page_Load(object sender, EventArgs e)
{
var s = Request.QueryString["page"];
ClientScript.RegisterStartupScript(GetType(), "gotorealpage",
"window.location=\"" + s + "\";", true);
}当然,您可以在Waiting.aspx中放置等待图像。
https://stackoverflow.com/questions/7185917
复制相似问题