ASP.NET 响应时,写入 iframe 完成
ASP.NET On Response.Write to iframe complete
我正在开发一个 ASP.NET 应用程序,旨在创建报告并将其下载到客户端。我正在使用发布到服务器的 iframe 执行此操作。操作完成后,将使用 Response.Write() 将报告下载到客户端。
同时,在客户端上,我正在显示一个 GIF 以指示服务器正在生成报告。当报告成功创建并完成写入客户端时,我想相应地更新 iframe,并隐藏 GIF。
有没有办法确定 response.write() 在 iframe 的父页面中是否成功?
父母:
<iframe id="iframe1" src="import-upload.html" width="100%" height="300" onload="loadFrame()" frameborder="0">
function redirect(type) {
iframe.getElementById('inputType').value = list.options[list.selectedIndex].value;
iframe.getElementById('inputAction').value = type;
document.getElementById("divOptionsContainer").style.display = "none";
document.getElementById("imgLoadingGif").style.display = "";
iframe.getElementById('frmUpload').submit();
}
帧源:
<div align="center">
<form id="frmUpload" action="AjaxFileHandler.aspx" method="POST" enctype="multipart/form-data" target="_self" style="margin-bottom:20px;">
<input id="fileupload" type="file" name="files[]" />
<input type="hidden" id="inputAction" name="action"/>
<input type="hidden" id="inputType" name="type"/>
</form>
<button id="btnReport" type="button" onclick="parent.redirect('Report')" style="">Report</button>
<button id="btnUpload" type="button" onclick="parent.redirect('Import')" style="">Import</button>
</div>
这是我的第一篇文章。如果需要更多信息,请告诉我。提前谢谢。
你可以听onload
iframe 的事件:
function redirect(type) {
iframe.getElementById('inputType').value = list.options[list.selectedIndex].value;
iframe.getElementById('inputAction').value = type;
document.getElementById("divOptionsContainer").style.display = "none";
document.getElementById("imgLoadingGif").style.display = "";
iframe.onload = function() {
document.getElementById("divOptionsContainer").style.display = "";
document.getElementById("imgLoadingGif").style.display = "none";
}
iframe.getElementById('frmUpload').submit();
}
相关文章:
- 防止Iframe窗体在新窗口中打开
- 将样式表插入iframe
- 在Twitter上用ie9中的空白src访问iframe的contentWindow
- 使用jQuery从原始页面内容创建iframe
- Highslide(iframe的侦听器)
- iframe正在添加标签,需要删除它们
- 通过javascript/html访问twitter共享iframe
- 在.csv文件中写入学位符号
- 如何在Facebook上的iframe应用程序中使后退按钮返回到上一页
- 如何使用Angular动态添加iframe-src
- 通过javascript在iframe中写入当前url
- 调用在 IE8 中从 iFrame 写入父级的父函数
- JQuery ,replaceWith() 从 iframe 写入会话后不起作用,除非页面刷新
- ASP.NET 响应时,写入 iframe 完成
- 使用javascript将图像动态写入iframe
- 需要帮助写入iFrame
- 不能在FF或IE中写入iframe,只能在Chrome中
- 几个文档.在边缘中写入iframe,导致SCRIPT70: Permission denied
- 在不使用document.write()的情况下将完整的html页面写入iframe
- 即使在iframe重定向到不同的url之后,也要继续将元素写入iframe