passing values from chil pop up to parent

V

Vinki

Hello Everyone,

I am trying to pass the value from my child window to my parent window. I
don't get the value from child to my parent when I refresh my parent page,
if I don't refresh my parent page then I get the value frtom my child window.
Below is the code in my parent window and child page. I need to refresh my
parent page because once the page refreshes and the child window closes, I
want some method to execute

btnSubmit.Attributes.Add("onclick", "window.open('newForm.aspx' ,
'CustomPopUp','width=600, height=400, statusbar=no, menubar=no,
resizable=no') ");
txtName.Text = hdnPopResult.Value; // assigning hidden filed value to a text
filed on asp.net page

my child window

function passvalues()
{

var txtValue = document.getElementById("txtSubmit").value;if(txtValue !="")
{

window.opener.form1.hdnPopResult.value = txtValue;

opener.document.location.reload();

window.close();



}





}

btnSubmit.Attributes.Add("onclick", "passvalues()");

Any help will be apprecaited.
 
M

Mark Rae [MVP]

I am trying to pass the value from my child window to my parent window. I
don't get the value from child to my parent when I refresh my parent
page,
if I don't refresh my parent page then I get the value frtom my child
window.

That's normal behaviour - think about it...

When you tell a page to reload, that's exactly what it will do i.e. it will
load in precisely the way that it loaded previously - it won't "remember"
the fact that it has been changed client-side *after* it was last loaded...
I need to refresh my parent page because once the page refreshes and the
child window closes, I want some method to execute

Is this method client-side or server-side?
 
B

bruce barker

you should submit the parent instead of reload.:

window.opener.form1.hdnPopResult.value = txtValue;
window.opener.form1.submit();


-- bruce (sqlwork.com)
 
V

Vinki

It is a server side code.

Mark Rae said:
That's normal behaviour - think about it...

When you tell a page to reload, that's exactly what it will do i.e. it will
load in precisely the way that it loaded previously - it won't "remember"
the fact that it has been changed client-side *after* it was last loaded...


Is this method client-side or server-side?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top