title: Using a StringBuilder to return to a $.post
body: <p>I'm trying to send back a WebService return to a Jquery Post using <strong>StringBuilder</strong> but the Jquery Post always get a error.</p>
  
  <p>I'm using a proxy page to call a <strong>Webservice</strong> because the call is cross domain.</p>
  
  <p>To call the proxy page I'm using this Jquery Post:</p>
  
  <pre><code>$.post("http://localhost/test/callWS.aspx/recordvideo", 
                   { eId : eId, 
                     id : iId,
                     usu_id : userId,
                     video : video })
  .done(function(data) {
          alert("Data Loaded: " + data);
  })
  .fail(function() { 
          alert("error");
   });
  </code></pre>
  
  <p>The <strong>callWS.aspx</strong> is the proxy page and the <strong>recordvideo</strong> is the WS method.</p>
  
  <p>This is what I use to return in CallWS.aspx  page.</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
          {
              StringBuilder sb = new StringBuilder();
              string result = "";
              string[] call = Request.PathInfo.Split('/');
              result = jsonSerialize(invokeMethod(typeof(WebService.EForm), call[call.Length - 1].ToString()));
              sb.Append(result);    
              Response.ContentType = "application/javascript";
              Response.Write(sb.ToString());
              Response.End();
  
          }
  </code></pre>
  
  <p>So, how can I send back the WS return without errors using this methods ?</p>