Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-05-11
4
Medium Priority
?
360 Views
Last Modified: 2012-05-11
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
Comment
Question by:pmac38CDS
  • 3
4 Comments
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 35736503
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
 
LVL 1

Author Comment

by:pmac38CDS
ID: 35740057
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
 
LVL 1

Accepted Solution

by:
pmac38CDS earned 0 total points
ID: 35893295
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
 
LVL 1

Author Closing Comment

by:pmac38CDS
ID: 35921363
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question