Reply
Highlighted
Member
Posts: 5
Registered: ‎05-08-2014
Accepted Solution

Embedded Seal disappears on postback.

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.


Accepted Solutions
Highlighted
Solution
Accepted by topic author liveclass
‎08-21-2015 01:58 AM
Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: Embedded Seal disappears on postback.

 

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

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author liveclass
‎08-21-2015 01:58 AM
Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: Embedded Seal disappears on postback.

 

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

Highlighted
Member
Posts: 5
Registered: ‎05-08-2014

Re: Embedded Seal disappears on postback.

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.

Highlighted
Member
Posts: 5
Registered: ‎05-08-2014

Re: Embedded Seal disappears on postback.

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.

Highlighted
Member
Posts: 5
Registered: ‎05-08-2014

Re: Embedded Seal disappears on postback.

Highlighted
Member
Posts: 5
Registered: ‎05-08-2014

Re: Embedded Seal disappears on postback.

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.