Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7825891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:11:40+00:00 2026-06-02T09:11:40+00:00

I have some JavaScript in a page that takes the values passed by a

  • 0

I have some JavaScript in a page that takes the values passed by a module Window and assigns it to a C# variable, so it can be used within the code behind. So my JavaScript looks like:

The JavaScript

<script type="text/javascript">

       function openSecure(args) {
           var manager = $find("<%= rwmSecure.ClientID %>");
           var domain = '<%=ConfigurationManager.AppSettings("CPCDomain").ToString %>';
           var URL;

           if (domain == 'localhost') {
               URL = 'http://localhost';
           }

           URL += "/WindowPage.aspx?args=" + args;
           manager.open(URL, "rwSecure");
       }
       function OnClientCloseSecure(oWnd, args) {
           var arg = args.get_argument();

           if (arg) {

               var ResultCode = arg.ResultCode;
               document.getElementById("hdnResultCode").value = ResultCode;
               var AuthCode = arg.AuthCode;
               var ReferenceNumber = arg.ReferenceNumber;
               var TransactionID = arg.TransactionID;
               var ErrorCode = arg.ErrorCode;
               var ErrorDescription = arg.ErrorDescription;
               var CardNumber = arg.CardNumber;
               var PONumber = arg.PONumber;
               //document.getElementById('<%=btn.ClientID %>').click();

               __doPostBack('pnlComplete', '');
           }
       }       
</script>

And to clarify this a bit more. The Module window is pulling in a page from localhost, but the Module window is being called from a page on localhost:61156. So once the javascript sets the variavle it also issues a click command on a asp.net button to run some code:

C# Code

protected void btn_Click(object sender, EventArgs e)
{
    if (string.IsNullOrEmpty(hdnResultCode.Value)) {
        dspConfirm();
        pnlComplete.Visible = false;
        pnlConfirm.Visible = true;
    } else {
        dspComplete();
        pnlComplete.Visible = true;
        pnlConfirm.Visible = false;
    }

}

So when I run this I get a javascript error that says:

Unsafe JavaScript attempt to access frame with URL http://localhost/SecurePayment.aspx?args=H4sIAAAAAAAEAOy9B2AcSZYlJi9tynt%2fSvVK1%2bB0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcplVmVdZhZAzO2dvPfee%2b%2b999577733ujudTif33%2f8%2fXGZkAWz2zkrayZ4hgKrIHz9%2bfB8%2fIr578jMnL09%2b5k3etG%2fqbNlk07aolj%2bzi%2bdndsY7u%2f9PAAAA%2f%2f8VkT5ZIQAAAA%3d%3d&rwndrnd=0.23641548841260374 from frame with URL http://localhost:65116/ShoppingCart.aspx. Domains, protocols and ports must match.
b.RadWindow._registerChildPageHandlersScriptResource.axd?d=vMihE91hOtu6KBE47c3D9AjqD9Il5YI4LpCLhSvp5YZn6p98cl2a_AbJJmNWVZfnmjtLnCnYEoaBHBC919OsikIEmKq8TGOzWNWN_HUBLLo8fW7DdN4EuN3Q076lAa_FOwh_Yk2b3DL-W2Fv0&t=38ec0598:1125
b.RadWindow._onIframeLoadScriptResource.axd?d=vMihE91hOtu6KBE47c3D9AjqD9Il5YI4LpCLhSvp5YZn6p98cl2a_AbJJmNWVZfnmjtLnCnYEoaBHBC919OsikIEmKq8TGOzWNWN_HUBLLo8fW7DdN4EuN3Q076lAa_FOwh_Yk2b3DL-W2Fv0&t=38ec0598:1143
(anonymous function)ScriptResource.axd:47
Sys$UI$DomEvent$addHandler.browserHandlerScriptResource.axd:4048

So is there any possible way around this or way to fix this? I’ve been scratching my head for two days and I’m ready to throw my keyboard. 🙂 Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T09:11:43+00:00Added an answer on June 2, 2026 at 9:11 am

    Your javascript error is pretty informative.

    Unsafe JavaScript attempt to access frame with URL
    http://localhost/SecurePayment.aspx?args=… from frame with URL
    http://localhost:65116/ShoppingCart.aspx. Domains, protocols and
    ports must match.

    This sounds like an exception with the Same Origin Policy

    The policy permits scripts running on pages originating from the same
    site to access each other’s methods and properties with no specific
    restrictions, but prevents access to most methods and properties
    across pages on different sites.[1]

    and

    The term “origin” is defined using the domain name, application layer
    protocol, and (in most browsers) port number of the HTML document
    running the script. Two resources are considered to be of the same
    origin if and only if all these values are exactly the same.

    Your script is running on your local machine in a site at a particular port, but trying to access a page on your local machine at a different port. I’d start there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php page and i have some javascript code to have a
Need some help from javascript gurus. I have one page where http://www.google.com/finance/converter is embedded
I have some javascript that goes out and fetches a javascript class on another
i have some javascript roll over code that works fine in firefox but when
I have some Javascript code that will programmatically register an COM interop assembly by
I have some JavaScript code that works in IE containing the following: myElement.innerText =
I have some javascript code that creates an img tag with a mouseover callback,
I have some Javascript code that creates 2 arrays: One for Product Category and
I have a C# ASP.NET app that creates a JavaScript array of values for
I have some javascript that i'm trying to use in a jsf app. I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.