title: How to access a javascript variable in c# code behind without using a hidden field
body: <p>I am storing the data in a variable and passing that to the <code>txt_val</code> attribute, stored as <code>'tooltip'</code>. I want to access this in my <code>c#</code> code, how can I do it?</p>
  
  <pre><code>function closediv(val1, txt_val, grp) {
      var data = val1.split("!~!");
      var value1 = data[0];
      $("#" + txt_val).attr('tooltip', value1);            
  }
  </code></pre>
  
  <p>I know it can be done using a hidden field, but this value is checked for multiple <code>textbox</code> controls, so if I use a hidden field control, I would need to use one hidden field for each textbox, that would result in a lot of repeated code. Is there a better way I can do it? Thank you</p>