Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<asp:Table> Vs html <table> [closed]

Tags:

html

asp.net

What are the differences between the ASP.Net control <asp:Table> compared to the old reliable table HTML implementation?

I know that the <asp:Table> will end up on the returned page as a HTML table, but does the ASP.Net control come with any benefits that I'm missing?

like image 781
keith Avatar asked May 07 '10 03:05

keith


People also ask

What is ASP table?

Table: ASP.NET table and its Helper Control Classes. Manages a collection of table cells such as adding a cell to a row or removing a cell from it. CONTROL. CODE. DESCRIPTION.

What is HTML table tags?

Definition and Usage. The <table> tag defines an HTML table. An HTML table consists of one <table> element and one or more <tr>, <th>, and <td> elements. The <tr> element defines a table row, the <th> element defines a table header, and the <td> element defines a table cell.


1 Answers

A "regular" <table> is not available for modification at all on the server side. As far as the server-side is concerned, it's just static text that gets output to the browser.

I would say that as a general rule, favour <table> unless you explicitly need to modify the structure of the table on the server. Using <asp:Table> means you have the overhead of running the code-behind for the table, generating the server-side control and so on. If you're not using any of that functionality, then there's no point.

Also, in general, <asp:DataTable> is typically more useful than just plain <asp:Table>, since it supports data-binding and so on.

Usually, if I just want to show/hide a single row in a table (or something) then I'll just put runat="server" on the single <tr> that I want to control, rather than using a whole <asp:Table>.

like image 170
Dean Harding Avatar answered Sep 28 '22 06:09

Dean Harding