点滴积累,融会贯通

-----喜欢一切有兴趣的东西

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

定义A页面,定义TextBox id="TextBox1"和Button id="Button1"
后台代码:

private void Page_Load(object sender, System.EventArgs e)
        
{
            
this.Button1.Attributes.Add("onclick","window.open('SelectData.aspx?rec=TextBox1','newwin','toolbar=no,menubar=no,status=no,location=no,resizable=no,scrollbars=no,width=218,height=185,top=190,left=300');return false;");
        }

定义界面B:  TextBox id="TextBox1"和Button id="Button1" 和type="hidden" id="name"
脚本:

<SCRIPT language="JavaScript">
            
var parwindow;
            parwindow
=self.opener;
            
var recv = document.all("name").value;
            
if (parwindow != null
            
{
            document.all(
"TextBox1").value=parwindow.document.all(recv).value;
            }

            
            
function changetext() 
            
{
                
if (parwindow != null
                
{
                    
try{
                            parwindow.document.all(recv).value 
= document.all("TextBox1").value;
                        }

                    
catch(e)
                        
{
                        }

                 }

            }

        
</SCRIPT>

 

放在form后
后台代码:

private void Page_Load(object sender, System.EventArgs e)
        
{
            name.Value 
= Request.QueryString[0];
            
this.Button1.Attributes.Add("onclick","changetext();window.close()");
        }

 

 


 


 

 

posted on 2006-02-16 11:33  小寒  阅读(562)  评论(0编辑  收藏  举报