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.
Mark Rae [MVP] - 07 Mar 2008 02:07 GMT
> 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?

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Vinki - 07 Mar 2008 18:14 GMT
It is a server side code.
> > 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
[quoted text clipped - 12 lines]
>
> Is this method client-side or server-side?
Mark Rae [MVP] - 07 Mar 2008 18:34 GMT
>> Is this method client-side or server-side?
>
> It is a server side code.
Bruce has already given you the correct answer...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
bruce barker - 07 Mar 2008 05:06 GMT
you should submit the parent instead of reload.:
window.opener.form1.hdnPopResult.value = txtValue;
window.opener.form1.submit();
-- bruce (sqlwork.com)
> Hello Everyone,
>
[quoted text clipped - 40 lines]
>
>