Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between <asp:table> and <table>?

Tags:

asp.net

Guys What is a difference between both??

if I set <table runat=server> I can use it at server side also.

Is there any differnce between both??

Thanx

like image 971
BreakHead Avatar asked Feb 04 '11 14:02

BreakHead


2 Answers

<asp:Table> is a .Net object that has specific properties and capabilities that can be utilized through .Net scripting or code behind logic. <table> is an Html element that can be accessed through scripting and code behind logic, but it has no native .Net capabilities and can only be output as is.

like image 107
Joel Etherton Avatar answered Oct 19 '22 09:10

Joel Etherton


asp:table lives in the System.Web.UI.WebControls namespace - these are components that wrap around the different HTML controls and provide a familiar interface and usage to winforms developers (for a table, it will have a Columns attribute).

table lives in the System.Web.UI.HtmlControls namespace and is a direct analogue to the actual HTML controls and provides an interface more familiar to HTML developers (for a table, it will have a Cols attribute).

In terms of output, these pretty much behave the same way.

like image 35
Oded Avatar answered Oct 19 '22 07:10

Oded