net打开子窗口传参数给父窗口

说明:点"查询"按钮打开子窗口,以GRIDVIEW显示,点每行后的选择按钮取到该行的指定单元格里的内容,传到父窗口的指定文本框中.

父窗口代码:

view plaincopy to clipboardprint?
function search(){  
        
      var obj = document.getElementById("<%=IPSName.ClientID%>").value;  
      window.showModalDialog("../jgctaxnet/IPSNameList.aspx?entName="+obj,window,"dialogHeight:500px;dialogWidth:700px,center:yes,resizable:no,status:no");  
 
  } 
 function search(){
      
       var obj = document.getElementById("<%=IPSName.ClientID%>").value;
       window.showModalDialog("../jgctaxnet/IPSNameList.aspx?entName="+obj,window,"dialogHeight:500px;dialogWidth:700px,center:yes,resizable:no,status:no");

   }

view plaincopy to clipboardprint?
 
 

子窗口代码:

view plaincopy to clipboardprint?
function insertValue(bt)  
   {  
       var tblRow = bt.parentNode.parentNode;//取得父节点的父节点,这里取得该行的对象  
       var returnValue = tblRow.cells[0].innerText;//取得改行第一个单元格里的内容  
       window.dialogArguments.document.getElementById("IPSName").value = Trim(returnValue);  
       window.close();  
   } 
 function insertValue(bt)
    {
        var tblRow = bt.parentNode.parentNode;//取得父节点的父节点,这里取得该行的对象
        var returnValue = tblRow.cells[0].innerText;//取得改行第一个单元格里的内容
        window.dialogArguments.document.getElementById("IPSName").value = Trim(returnValue);
        window.close();
    }

view plaincopy to clipboardprint?
 
   

 
       
 
             
                                             BackColor="White" Height="15px" Font-Size="10pt"> 
                 
                      
                          
                             
                                 
                                     
                                     
                                 
                         
                                 
                               
 
                                     
                                     
                                 
                         
                     
                 
                          
                     没有此施工单位的记录! 
               
 
             
         
     
 

   
       

           
                                             BackColor="White" Height="15px" Font-Size="10pt">
               
                    
                        
                           
施工单位操    作
 
                                        "/> 
                                        <%# Eval("QYMC") %> 
                                   
 
                                          
                                   

                               
                                   
                                   
                               
                       
                              
                               

                                   
                                   
                               
                       
                   
               
                       
                     没有此施工单位的记录!
               

           
       
   

后台:

view plaincopy to clipboardprint?
protected void Page_Load(object sender, EventArgs e)  
    {  
        string entName = Request.QueryString["entName"];//获取请求所传的参数  
        string cmd_sql = "select t.QYMC from jgcuser.xkz t where t.QYMC like '%" + entName + "%'";  
        Config config = new Config();  
        DataSet ds = config.GetResult(cmd_sql);  
        GridView1.DataSource = ds;  
        GridView1.DataBind();  
        config.Close();  
    } 

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/hli33/archive/2009/08/13/4443873.aspx

你可能感兴趣的:(ASP.NET)

施工单位操    作

                                        "/>
                                        <%# Eval("QYMC") %>