Whenever I perform a postback on my page the embedded seal disappears.
Is there a way to keep this from happening?
note: If I do a refresh the seal reappears.
Solved! Go to Solution.
05-08-2014 04:14 PM
Hi,
The Authorize.Net secure seal is relatively simple javascript that should load in the same way regardless of whether the page was loaded through a post or not.
I would have to guess something else is happening that prevents the javascript from running.
Thanks,
Joy
05-14-2014 12:31 PM
Hi,
The Authorize.Net secure seal is relatively simple javascript that should load in the same way regardless of whether the page was loaded through a post or not.
I would have to guess something else is happening that prevents the javascript from running.
Thanks,
Joy
05-14-2014 12:31 PM
I'm running into this issue again using ASP.NET and C#. Some of the ASP Form elements cause a "partial postback" onclick. This causes the javascript to not reload the Authorize.net image.
I've also tried wrapping the ANS_customer_id in a page request manager like so:
var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(function () { var ANS_customer_id = "<my customer id>"; });
This did not work. My guess is that "seal.js" needs to have the page request manager code added to handle partial postbacks.
In general it does not matter whether the external javascript is simple it not. What matters is that I wrap it in prm.add_endRequest(). Much of the javascript on my ASP.NET site breaks on partial postback unless the page request manager is used.
04-16-2015 09:39 AM
I've also tried dynamically loading the javascript. Using a solution found here.
function loadjscssfile(filename, filetype) { if (filetype == "js") { //if filename is a external JavaScript file var fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); fileref.setAttribute("src", filename); } else if (filetype == "css") { //if filename is an external CSS file var fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", filename); } if (typeof fileref != "undefined") { document.getElementsByTagName("head")[0].appendChild(fileref); }
} loadjscssfile("//verify.authorize.net/anetseal/seal.js", "js"); //dynamically load and add this .js file
// Handle Partial Postback
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function () {
loadjscssfile("//verify.authorize.net/anetseal/seal.js", "js");
});
This did not work either.
04-16-2015 10:11 AM
Here are some posts on stackoverflow about reloading javascript on postback or partial postback.
04-16-2015 10:22 AM
I tried this:
function pageLoad(sender, args) { <copied and pasted the code I found here: https://verify.authorize.net/anetseal/seal.js> }
In this case, the page loaded everything and then quickly replaced everything with the Authorize.Net seal.
04-16-2015 10:39 AM