Re: How to call parent window method from model popup window?
Nov 22, 2010 02:35 AM|Ming Xu - MSFT|LINK
Dec 31, 2008 Hi, i dont think that it is possible to call a child window function without opening the child window. You can put the function in a common js file and include in both parent and child window (Only if it is a common mathematical or string manipulation function which does not.
Hi,
According to your description ,for my experience you can use window.returnValue(JavaScript) in model.aspx page to pass the value from child page to parent page.
Please keep in mind that returnValue Property applies only to windows created by using the showModalDialog method.
mundra_83
how can i get this id on my Parent.aspx.cs file?
Here is a sample:
1.Create a parent page named as ParentPage.aspx.Open the child page by using window.showModalDialog(JavaScript) method.
When the child page return the value ,use a hiddenfield control to contain the value and then access the value in ParentPage.aspx.cs.
Code in parent page(.aspx):
Code in parent page(.cs):
2.Create a child page named as model.aspx(Please do not forget add <base target='_self' /> code in .aspx file).
Code in childpage(.aspx):
![Call Parent Window Js Function From Iframe Scrolling Call Parent Window Js Function From Iframe Scrolling](/uploads/1/2/5/8/125853287/930319058.png)
Code in childpage(.cs):
I would like to suggest you that please check the links below for more information about returnValue Property and showModalDialog Method.
Hope it can help you.