title: Why is my server code ajax call returning a response wrapped in double-quotes?
body: <p>I am doing an ajax call from my javascript to an aspx page's webmethod. The string I'm returning is wrapped in double-quotes for some reason. I tried stripping them out, but the replace only replaced the first one for some reason. There are no quotes wrapping the string on the server-side. </p>
  
  <pre><code>        var req = new XMLHttpRequest();
          var url = document.URL;
          // strip pound sign off the end
          var poundIndex = url.lastIndexOf('#');
  
          if (poundIndex === url.length - 1) {
              url = url.substring(0, poundIndex);
          }
          url += '/SignOn';
          req.open('post', url, false);
          req.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
          req.send();
  
          var serverResponse = req.responseText.replace('"', '');
  </code></pre>
  
  <p>This is what I'm doing on the server: </p>
  
  <pre><code>Return System.Configuration.ConfigurationManager.AppSettings("url").ToString + "?token=" + HttpContext.Current.Session("Token").ToString() + "&amp;aid=ca"
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/IASR1.png" alt="enter image description here"></p>
  
  <p>Any ideas? </p>