-For Parent Page Open Child Window
protected void Page_Load(object sender, EventArgs e)
{
string openWindow = @”window.open(‘Child.aspx’)”;
this.Button1.Attributes.Add(“onclick”, openWindow);
}
For Child Page
this.LinkButton1.Attributes.Add(“onclick”, “PassValues()”);
Write this Code for Javascript in Child Page
This code will pass value in Window.opener Form With Given Text Box
<script language=javascript>
function PassValues()
{
var txtValue = document.getElementById(“<%=TextBox1.ClientID%>”).value
window.opener.form1.txtUserName.value = txtValue;
window.close();
}
</script>
Pingback: Free tutorials , with examples and source code for the developers