Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

A particular aspx page opens another aspx page through javascript.
Once the child window's work is done, the user presses a button in it.

And once that is done I need to perform these actions in the javascript methods of the child aspx window

C#
function fnSave(){
/*LINE 1: Replace this line with code to : Update an update panel in the opener window*/
/*LINE 2:*/ self.close();
}


This fnSave Javascript function (present in the child window) will be called on clicking of a button in the child window.

Can you help me the first part? The update action is just update. No parameters passed or anything. All my research on this are turning to be futile.
Posted
Updated 14-Sep-11 1:37am
v5
Comments
Suresh Suthar 14-Sep-11 7:33am    
When this fnSave function will be called?
[no name] 14-Sep-11 7:36am    
I've updated the question with your doubt clarified.
Suresh Suthar 14-Sep-11 7:41am    
If UpdatePanel is in child page (child window) than what is the problem?
Use AsynPostBackTrigger or just place that button in UpdatePanel.

Or still I have not understood question?
[no name] 14-Sep-11 7:43am    
As I've mentioned, the UpdatePanel is in the opener/parent window and not in the child window.

1 solution

You can use
JavaScript
window.opener.document.forms(0).submit();
to submit parent page.

Or you can add a button control with style="display:none" and add this button to UpdatePanel's AsyncPostBackTrigger. Than create this function on parent page
JavaScript
function raiseAsyncPostback() {
         __doPostBack("<%= this.YourButtonID.UniqueID %>", "");
     }

and call this function in your child using window.opener.raiseAsyncPostback();.

This will surly solve your problem.
 
Share this answer
 
v3
Comments
[no name] 15-Sep-11 6:19am    
Suresh, this is not a scalable solution. I have a similiar 10 update panel. Adding an invisible button is not a good work around.

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