title: Send large String data from HTML/Javascript to code behind
body: <p>Our application has some hidden fields like any other asp.net application. Here we are using hidden fields to store HTML of an image, which is considerably large. We use the value(large HTML string) of hidden field in our C# code for further processing.</p>
  
  <p>We tend to create 4 instances of our application and we have doubts over load balancing of azure cloud service. We assign values to these hidden fields in midway of our application process through javascript. As this processing is done on client side there are no issues here. But since azure has multiple instances so if want to access these hidden fields on server side (i.e. in our C#), accessing these hidden fields directly would create any problem due to load balancing if the instance changes ?</p>
  
  <blockquote>
    <p>Note: Our page does not postback while accessing these hidden fields
    on the server side.</p>
  </blockquote>
  
  <p>We are not clear when does the instance change, if our page does not postback then will the request go the same instance ? Is this guaranteed.
  Also if the page does postback then does the response goes to the same instance of the calling request instance.</p>
  
  <p>We need suggestions or the correct way of accessing these hidden fields on the server side. These hidden fields are very important to us; using the cache/session settings of azure will become very costly for us since the data is very large. It would be very helpful if the suggestion would be for cost free implementation. As we are already running on a tight budget.</p>
  
  <p>//25Oct 2013</p>
  
  <p>We have a large string of data, which is majorly made up of HTML obtained from Bing Map, we have taken the HTML of the Bing map using the Jquery Selector of our Bing Map div element, we want this HTML string to be sent to the code behind. We have this string on our javascript but when we do ajax call to the code behind it fails.</p>
  
  <p>We even tried to send it in body via a POST method, but this fails again.</p>
  
  <pre><code> var string = formData; // so long text
          var xhr = new XMLHttpRequest();
          var body = "string=" + encodeURIComponent(string);
          xhr.open("POST", "index.aspx/getString", true);
          xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          xhr.setRequestHeader("Content-Length", body.length);
          xhr.setRequestHeader("Connection", "close");
          xhr.send(body);
  </code></pre>
  
  <p>As Rick suggested, we had already tried blob but the problem is with sending the string from javascript to code behind. We are really stuck on the dead end here.</p>