Data transfer methods asp.net/javascript

0

I have the following scenario:

I am implementing payment for transparent paging checkout.

Some functions with a return can only be executed via javascript (Returns like credit card token, PagSeguro session id, etc.).

The cart already exists and is ready (and not made by anyone who speaks to you), implemented in Asp.net WebForms.

I'm having a hard time passing the information I get from javascript to Asp.

I have a buy end button, in this button I would have to execute both of these javascript methods receive this value, and pass to the asp process and finalize the operation, the problem and that when I click this button it does not run the events javascript bindings it goes straight into asp

I'm tethering the event like this:     document.getElementById ("ContentPlaceHolder1_cmdAvancar"). addEventListener ("click", getCardToken);

And importing js into the page at the end of the body this way:

<script src="assets/js/PagSeguro.js"></script>

Apparently this js is not running before asp executes the button event.

Any idea how to pass the data from the jd pro asp, or run these js first?

If I run these js I would throw the values into hidden inputs and then I would get the asp.

    
asked by anonymous 08.02.2017 / 20:25

0 answers