How Dynamically Add Rows into ASP.NET Table using C#

Posted by Shubham under C# category on | Points: 40 | Views : 9777
You need to first create a row and then create a cell assign the properties of cell and then add the cell to row and then row to table.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
TableRow tr = new TableRow();
TableCell tc = new TableCell();
tc.Text = "";
TableCell tc2 = new TableCell();
tc2.Text = "";

<form id="form1" runat="server">
<asp:table ID="tblSample" runat="server"></asp:table>

Comments or Responses

Login to post response