用javascript脚本实现:
window.opener.document.location.href='你的页面名字'
window.opener.document.location.href='你的页面名字'
解决方案 »
- 关于repeater控件动态创建的按钮,不能触发ItemCommand的问题
- 关于Treeview绑定数据库的问题
- C#.NET 请教怎么引用不在APP_CODE下的类
- 高分求解:怎样用javascript控制Datalist中Label的字体大小。本人菜鸟,望各大虾帮忙。
- 请Repeater中eval的用法,eval能不能和判断语句结合起来?
- 关于C#中值类型中内存中的存储情况
- 可怜可怜我吧,我已经被这个问题折磨了2天了。求大家了!
- 如何给multipage中pageview的TextArea赋值
- datagrid 如何才能单击选中行?
- 很奇怪的问题
- 来看看吧,会有好处的
- 求一网站地址,很常用,但突然想不起来了。
function openwindow(){
var txt=window.showModalDialog("test.aspx");
if(txt!="")
document.forms[0].submit();
}
只要你看懂以下代码就知道怎么传值了,function openWindowModalDialog(strHref,pWidth,pHeight) {
var strRef="";
strRef=strRef+"dialogWidth="+pWidth+"px;dialogHeight="+pHeight+"px;";
strRef=strRef+"dialogLeft="+(screen.availWidth/2-pWidth/2)+"px;dialogTop="+(screen.availHeight/2-pHeight/2)+"px;";
strRef=strRef+"resizable=no;scroll=no;status=no;help=no";
var returnvalue = window.showModalDialog(strHref,"ALink",strRef);
if (returnvalue == true)//这是接收值的,returnvalue就是得到他的反回值
location.href = location.href;
else if (returnvalue != false && returnvalue != '' && typeof(returnvalue) != 'undefined')
{
if (returnvalue.indexOf('target=print')>=0)
openPrintWindow(returnvalue);
else
location.href = returnvalue;
}
}function openPrintWindow(strHref) {
var pWidth=screen.Width-12;
var pHeight=screen.Height-120;
var strRef="left=0,top=0,width="+pWidth+"px,height="+pHeight+"px,resizable=yes,scrollbars=yes,status=yes,toolbar=yes,menubar=yes,location=no,borderSize=thin";
window.open(strHref,"ALink",strRef,false);
}
//----------------------在这里调用:<A style="Z-INDEX: 101; LEFT: 95px; POSITION: absolute; TOP: 63px" href="javascript:openWindowModalDialog('Base_Setup_AssStuType_Frame.aspx?Mode=1',620,302);">添加</A>
//-----------------------在模式窗体页面里这样调用Context.Response.Write("<script>window.returnValue = true;window.close();</script>"); // 这是反回刷新父窗体,
Context.Response.Write("<script>window.returnValue = false;window.close();</script>"); // 这是不反回 直接关闭
//#########################在html中增加一个隐藏按钮:<input type="hide" id="hidebtn" runat="server">
//主界面; javascript
function openwindow(){
var txt=window.showModalDialog("test.aspx");
if(txt!=""){
document.all["hidebtn"].value=txt;
document.forms[0].submit();
}
}//在c#接收 string txt= this.hidebtn.value ;