webform中如何往iframe所指引的webform中传入参数,如何获取其返回值?
解决方案 »
- 如何用C#在oracle的指定表中取一个数据然后再添加点东西存到一个指定的文本文件中
- 菜单栏效果
- 网站内容更新问题
- 想问下批量导入JS的方法
- asp.net如何实现多语言
- Gridview控件内部问题
- ASP.NET在那里编译比较好?
- 框架刷新的一个怪难动作!!
- net菜鸟请问一下大家,命名空间“BLL”中不存在类型或命名空间名称“ShoppingCartManager”(是否缺少程序集引用?)怎么解决?
- 我将一个datagrid绑定到一个表(在程序中dataview实现),怎么让它隐藏关键字段的显示,而且能在删除记录的时候取到这个ID号。。谢谢
- 浏览器关闭问题
- 弹出窗口选择yes-no的问题。
parent.document.all("xx").value = xxx;
也可在父页面直接读取IFRAME页面中的值
document.frames[0].document.all("xxx").value;
谢谢各位,web不熟悉再请问一下,如何在主webform中设置一个打印按钮,但是打印的是iframe的webform?
{
var pp = frames['ifrm'];
//alert(pp.location.href);
pp.focus();
pp.print();
}
</script>
<input type="button" name="someButton" value="打印" onclick="javascript:printFrame()" style="WIDTH: 88px; HEIGHT: 32px">或者
<input type="button" name="someButton" value="打印1" onclick="ifrm.focus();ifrm.print();" style="WIDTH: 88px; HEIGHT: 32px">ifrm:我页面上的iframe
<script language="javascript">
function PrintIFrame()
{
document.myiframe.focus();
document.myiframe.print();
}
</script>
<body>
<iframe name="myiframe" id="myiframe"
src="content.htm"></iframe>
<input type="button" value="Print" onClick="PrintIFrame
()">
</body>
</html>/////////////////////////////////////////////////////////////////////////////
<frameset rows="50%,*">
<frame src="page1.htm" name=page1>
<frame src="page2.htm" name=page2>
</frameset>If you want to print all pages in page1.htm,you can do it like this: parent.page2.focus()
parent.page2.print()
window.focus()
window.print()
It will print page1.htm and page2.htm
//////////////////////////////////////////////////////////////////////function call_print()
{
window.parent.someframename.print();
} just call this function from a button's onclick....
///////////////////////////////////////////////////////////////////
In NN4+ you just call
frameReference.print()
e.g.
parent.frameName.print()
For IE5 you have to set focus on the frame first so you need
parent.frameName.focus();
parent.frameName.print();
<script language=JavaScript> function CheckIsIE()
{
if (navigator.appName.toUpperCase() == 'MICROSOFT
INTERNET EXPLORER') { return true;}
else { return false; }
}
function PrintThisPage()
{ if (CheckIsIE() == true)
{
document.ifWorkspace.focus();
document.ifWorkspace.print();
}
else
{
window.frames['ifWorkspace'].focus();
window.frames['ifWorkspace'].print();
} } </script> In the parent window, just put a link or button to call the PrintThisPage() method: <a href="javascript:PrintThisPage();" >Print This Page</a>