Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add dynamic rows to a table on C#

Tags:

jquery

c#

Hi i have a table and i want to add dynamic rows to that through C# ... how can i do this.... advance thanks

like image 473
Nithesh Narayanan Avatar asked Dec 01 '25 17:12

Nithesh Narayanan


1 Answers

You can add new rows in html table via javascript

<asp:Button ID="btnTest" runat="server" Text="Check" OnClientClick="javascript:return AddRow();"/>



<script type="text/javascript" >
           var mytable = document.getElementById('mytableID');
           function AddRow() {
               var row = document.createElement('tr');
               mytable.appendChild(row);
               return false;
           }
       </script>
like image 115
AsifQadri Avatar answered Dec 03 '25 09:12

AsifQadri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!