LinkButton in a repeater 'onclick' assigns a value to a hidden input
<p>I have a <code>asp:LinkButton</code> that's inside a repeater , that has a <code>commandname</code> containing an <code>ID</code></p>

<pre><code> &lt;table&gt;                    
        &lt;asp:Repeater ID = "rptr" runat = "server"&gt;
         &lt;ItemTemplate&gt;
             &lt;tr&gt;

                &lt;td&gt;
                     &lt;asp:LinkButton ID = "lbtn" runat = "server" 
                        text = '&lt;%#showData(Container.DataItem, "CommonName")%&gt;' 
                        CommandName = '&lt;%#showData(Container.DataItem, "ID")%&gt;' 
                        CommandArgument = '&lt;%#showData(Container.DataItem, "CommonName")%&gt;'  /&gt;

                &lt;/td&gt;
                    &lt;/tr&gt;
         &lt;/ItemTemplate&gt;
         &lt;/asp:Repeater&gt;
    &lt;/table&gt;
</code></pre>

<p>Also, I have a hidden <code>input</code> field: (outside of the repeater)</p>

<pre><code>&lt;input type = "hidden" id = "ID" runat = "server" /&gt;
</code></pre>

<p>The repeater populates many <code>asp:LinkButton</code>, and each one has a unique <code>ID</code> that's stored in the <code>commandname</code>. when a <code>asp:LinkButton</code> is clicked, I want the hidden input value to store the <code>commandname</code> of the button that's been clicked. </p>

<p>I know that I have to use some sort of javascript function in the <code>onclick</code> event. But I am not able to figure out the specific way to do it.</p>

<p>Thanks in advance.</p>