Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends,

How to return a value from popup page to parent page in asp.net with out passing parent controls to pop up window using javascript
Posted
Comments
VC.J 15-Oct-14 0:19am    
call javascript function on closing of your popup
and from that function call javascript function of parent page like

function childPageFunction(){
parent.ParentpageJavascriptFunction();
}
Baroor 15-Oct-14 0:25am    
i dont want to send any parent function or control to child, i want to get the complete result to parent then i want to assgn value to the controls of parent.
VC.J 15-Oct-14 0:29am    
is it a specific requirement as u have to at-least call javascript function otherwise I am suspicious that you will achieve what you want.
I am providing you a code sample have a look
Baroor 15-Oct-14 0:39am    
Actually this is not for one page, if i called popup function from another page which doesnt have method which we was calling previously in pop up function it will cause to javascript error.

1 solution

C#
function ClosePage() {
var resultValue = "successfully saved";
        var IsSuccess = true;
    window.parent.OpenParentFunction(resultValue, IsSuccess);
}


in parent page : you function would be something like that

C#
function OpenParentFunction(result, isSuccess) {
    if(isSuccess)
     alert(result);
else
alert('problem in the popup page ');
}
 
Share this answer
 
Comments
Baroor 15-Oct-14 0:45am    
can we access popup window controls from parent in this scenario?????
VC.J 15-Oct-14 1:00am    
I dont think so

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900