Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

passing values from chil pop up to parent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinki - 07 Mar 2008 01:37 GMT
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]
>
>  

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.