title: pass parameter to one function in the code behind in C# from javascript
body: <p>I am trying to pass parameter to one function in the code behind in C# from javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
  
          $("#some_id").click(function () {
              var id = document.getElementById('HiddenField2');
              var a = &lt;%=btn_Click(id)%&gt;;
          });
  
      });
  &lt;/script&gt;
  &lt;asp:HiddenField ID="HiddenField2" runat="server" Value='&lt;%# DataBinder.Eval(Container.DataItem, "item_id")%&gt;' /&gt;
  code behind
   public string btn_Click(String item_id)
      {
          /*do some thing*/
  
          return null;
      }  
  </code></pre>
  
  <p>But this piece of code always giving me error of context. That id is not defined in this context.
  Can some please let me know what wrong i am doing?</p>