• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 362
  • Last Modified:

Passing values back from an aspx page(popup window) to an html page

I have an html page with a button called Donate. When the user clicks on that button an aspx page opens up in a pop up window. The aspx page contains data which is filled in by the end user. When the user clicks on the Submit Payment button the backend code calls PayPal's PayFlow Pro API to processes that information. If the transaction is successful it returns an Authentication Code. I would like to pass this Authenticate Code back to the HTML page.

Is there anyway I can achieve this ?
Thanks,
Aditya
0
pmac38CDS
Asked:
pmac38CDS
  • 3
1 Solution
 
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
This is simple task and can be done with javascript by calling parent window javascript methods/fields from popup with
window.opener.PranentMethod ...
window.opener.fileds...

please follow these links:
http://chiragrdarji.wordpress.com/2007/03/10/call-parent-windows-javascript-function-from-child-window-or-passing-data-from-child-window-to-parent-window-in-javascript/
http://stackoverflow.com/questions/4350223/passing-data-between-a-parent-window-and-a-child-popup-window-with-jquery

Thanks

0
 
pmac38CDSAuthor Commented:
Those solutions won't work in my case since I need to process some information before closing the pop up. Also I need to pass the authentication code back to the parent form.
0
 
pmac38CDSAuthor Commented:
Nevermind I was able to solve this issue.I use the following to implement the functionality
Page.RegisterStartupScript("myScript", "<script language=JavaScript>signalPostback('" + this.authCode + "','" + this.transactionResponse + "');</script>");

 function signalPostback(authCode, transactionResponse) {
        window.opener.document.getElementById('TXT_AuthCode').value = authCode;
        window.opener.document.getElementById('TXT_Response').value = transactionResponse;
        window.close();
    }
0
 
pmac38CDSAuthor Commented:
Nevermind I was able to solve this issue.I use the following to implement the functionality
Page.RegisterStartupScript("myScript", "<script language=JavaScript>signalPostback('" + this.authCode + "','" + this.transactionResponse + "');</script>");

 function signalPostback(authCode, transactionResponse) {
        window.opener.document.getElementById('TXT_AuthCode').value = authCode;
        window.opener.document.getElementById('TXT_Response').value = transactionResponse;
        window.close();
    }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now