How to get value set in javascript from code-behind?
<p>I set value in a hidden field like this:</p>

<pre><code>((TextBox)ctrl).Attributes.Add("onchange", "document.getElementById('" + 
  ((BasePage)Page).GetControl(Page, "ChangedRowsIndicesHiddenField").ClientID + 
  "').value.concat('" + row.RowIndex + ",');");
</code></pre>

<p>In page source it looks like this:</p>

<pre><code>onchange="document.getElementById('ctl00_CPHDefault_tcTPS_TPProd_ctl01_tcProduction_TPNewTitlesStatus_ChangedRowsIndicesHiddenField').value.concat('0,');" 
</code></pre>

<p>I want to be able to retrieve and use this value from code-behind on postback (button click):</p>

<pre><code>string ChangedRowsIndices = ChangedRowsIndicesHiddenField.Value.TrimEnd(',');
</code></pre>

<p>But because of some reason, ChangedRowsIndices is always empty. Could you please help me with this? What am I doing wrong?
Here is the hidden field:</p>

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

<p>Thanks.</p>
