title: Access is denied. JavaScript error on request to secured page
body: <p>On page <code>SomePage.aspx</code>, by JavaScript code (XMLHttpRequest) I call <code>SecuredPage.aspx</code> used next code:</p>
  
  <pre><code>    var httpRequest = GetXmlHttp();
      var url = "https://myhost.com/SecuredPage.aspx";
  
      var params = "param1=" + document.getElementById('param1').value +
                  "&amp;param2=" + document.getElementById('param2').value;
  
      httpRequest.open("POST", url, true);
      httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  
      httpRequest.onreadystatechange = function() {
          //Call a function when the state changes.
          if (httpRequest.readyState == 4 &amp;&amp; httpRequest.status == 200) {
              alert(httpRequest.responseText);
          }
      }
      httpRequest.send(params); // HERE ACCESS IS DENIED.
  
      //---------------------------------------------
      function GetXmlHttp() {
          var xmlhttp = false;
          if (window.XMLHttpRequest) {
              xmlhttp = new XMLHttpRequest();
          }
          else if (window.ActiveXObject)
          // Code for Internet Explorer.
          {
              try {
                  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              }
              catch (e) {
                  try {
                      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch (E) {
                      xmlhttp = false;
                  }
              }
          }
          return xmlhttp;
      }
  </code></pre>
  
  <p>It throws an <em>Access is denied</em> error. If send to http (http://myhost.com/SecuredPage.aspx), it works fine.</p>
  
  <p>How is it possible to resolve this problem?</p>