弹出窗口代码

时间:2012-03-27 13:05:47

标签: asp.net

我有2个aspax页面。 client.aspx popup.aspx

client.aspx包含一个简单的注册表单。在这种形式,我必须从popup.aspx中取一个文本框值。该文本框包含搜索按钮

当我点击搜索按钮时,popup.aspx页面会在弹出窗口中打开。

在popup.aspx中的

我显示一个网格包含productCode和产品名称以及一个选择按钮。 当我选择一行网格时,应在文本框中显示相应的产品名称。然后应该关闭弹出窗口。

更新

    ImageButton imgbut = sender as ImageButton; 
    GridViewRow gvr = (GridViewRow)imgbut.NamingContainer; 
    lblKeyIndex.Text =  grd_ProductMaster.DataKeys[gvr.RowIndex].Value.ToString(); 
    lblProductName.Text = gvr.Cells[2].Text; 
    Session["ProdName"] = lblProductName.Text;
    Server.Transfer("client_Master.aspx");
    Response.Write("<Script>window.close()</Script>");       Response.Redirect("client_Master.aspx?ProdName=" +        lblProductName.Text+"&ProdCode="+lblKeyIndex.Text)

在client.aspx的页面加载

if (Session["ProdName"] != null) 
{ 
 txtSelectProdName.Text = Session["ProdName"].ToString();
} 

1 个答案:

答案 0 :(得分:0)

打开pop-up window

在弹出窗口中尝试return the value to parent window

相关问题