title: JavaScript Pass button id to an asp.net hiddenfield
body: <p>I got a silly question just as the question stated,the failed code shown below:    </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function HISenlarge(id) {
      var parent = id;
      document.getElementById('HiddenField1').value = parent;
   }
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;button type="button"  id="kkkk" onclick="HISenlarge(this.id)"&gt;&lt;/button&gt;
  &lt;asp:HiddenField ID="HiddenField1" runat="server" value=""/&gt;
  </code></pre>
  
  <p>VBcode  </p>
  
  <pre><code> Protected Sub CommentButton_Click(sender As Object, e As EventArgs) Handles CommentButton.Click
      Dim c_id As String
      c_id = HiddenField1.Value.ToString
  </code></pre>