Hi man i will post this to help you in the situation
Here's the code for the parent page:
[COLOR=blue]public[/COLOR] [COLOR=blue]class[/COLOR] Default : Page
{
[COLOR=blue]protected[/COLOR] TextBox txtFirstName;
[COLOR=blue]protected[/COLOR] TextBox txtLastName;
[COLOR=blue]protected[/COLOR] Label Label1;
[COLOR=blue]protected[/COLOR] Label Label2;
[COLOR=blue]protected[/COLOR] HyperLink HyperLink1;
[COLOR=blue]private[/COLOR] [COLOR=blue]void[/COLOR] Page_Load([COLOR=blue]object[/COLOR] sender, EventArgs e)
{
[COLOR=green]//create our update function[/COLOR]
[COLOR=blue]string[/COLOR] scr = @"<script>
function update(elemValue)
{
document.getElementById('txtFirstName').innerText=elemValue[0];
document.getElementById('txtLastName').innerText=elemValue[1];
}
</script>";
[COLOR=green]// register the javascript into the Page[/COLOR]
Page.RegisterClientScriptBlock("update", scr);
[COLOR=green]//add our popup onclick attribute to the desired element on the page (Here, Hyperlink1)[/COLOR]
HyperLink1.Attributes.Add("onclick", "window.open('popup.aspx',null,'left=400, top=100, height=250, width= 250, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');");
}
And, here's the code for the child "Popup" page:
[COLOR=blue]public[/COLOR] [COLOR=blue]class[/COLOR] popup : System.Web.UI.Page
{
[COLOR=blue]protected[/COLOR] System.Web.UI.WebControls.TextBox TextBox1;
[COLOR=blue]protected[/COLOR] System.Web.UI.WebControls.Label Label2;
[COLOR=blue]protected[/COLOR] System.Web.UI.WebControls.TextBox txtLastName;
[COLOR=blue]protected[/COLOR] System.Web.UI.WebControls.TextBox txtFirstName;
[COLOR=blue]protected[/COLOR] System.Web.UI.WebControls.Label Label1;
[COLOR=blue]private[/COLOR] [COLOR=blue]void[/COLOR] Page_Load([COLOR=blue]object[/COLOR] sender, System.EventArgs e)
{
[COLOR=blue]string[/COLOR] scr= @"<script>
function Done()
{
var fName=document.getElementById('txtFirstName').value;
var lName=document.getElementById('txtLastName').value;
var ret= new Array(fName,lName);
window.opener.update(ret);
window.close();
}
</script>;";
Page.RegisterClientScriptBlock("done", scr);
}