Asp.net How to pass Value From Child Page to Parent Page

-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>

Advertisement

One thought on “Asp.net How to pass Value From Child Page to Parent Page

  1. Pingback: Free tutorials , with examples and source code for the developers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s