My ASPX page contains a table with headings. I am dynamically adding rows to the table using JavaScript, but when trying to access these newly added rows on the server side, I can only see the heading row and not the new ones. The table always appears to have only one row, and I am unable to access the dynamically added rows.
ASPX page
<table runat="server" id="tblNew" clientidmode="Static">
<tr>
<th>
Column1
</th>
<th>
Column2
</th>
</tr>
</table>
Javascript function for adding rows.
var table = document.getElementById("SelectedItems");
var newrow = table.insertRow(0);
var newcel0 = newrow.insertCell(0);
var newcel1 = newrow.insertCell(1);
CS TO access table rows
int rowCount=tblNew.Rows.Count;
Despite my efforts, I consistently receive a count value of one. Any help would be greatly appreciated.