title: Better approach than hidden field to store data in html
body: <p>I'd like to know if a better approach exists  to store data in html content.<br />
  At the moment I got some values stored in my html file using hidden field. These values are generated by code behind.<br /></p>
  
  <p><strong>Html:</strong></p>
  
  <pre><code>&lt;input type="hidden" id="hid1" value="generatedValue1" /&gt;
  &lt;input type="hidden" id="hid2" value="generatedValue2" /&gt;
  </code></pre>
  
  <p>And therefore I get those values on client side using jquery, in order to pass them to an ajax request.</p>
  
  <p><strong>JQuery</strong></p>
  
  <pre><code>$.ajax({
    data:{
       var1 : $('#hid1').val(),
       var2 : $('#hid2').val()
    }
  );
  </code></pre>
  
  <p>So is this the correct way to do this, or does it exist a smoother solution to achieve the same result? Since I don't need these values to be posted on page submit the <code>input hidden</code>is probably gross. </p>