which is best to <asp:table> or <table>

Posted by Kannan1986 under ASP.NET on 2/6/2010 | Views : 1019 | Status : [Member] | Replies : 5
which one is best to create table in .aspx page ..
<asp:table> or <table>




Responses

Posted by: Poster on: 2/6/2010 [Member] Starter

Up
0
Down
<asp:table> ????? no way. It creates a lot of viewstate.

My preference is always use html controls if you can and avoid server controls. asp:table is useful if you want to create table from server side, however there is alternative as well you can form the <table> tags in the server side and write on the aspx page that will solve the purpose. So never use asp:table it creates a hell lot of server controls.

Thanks


Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 2/6/2010 [Member] Bronze

Up
0
Down
It is better to use the HTML control instead of ASP controls.

If you want the control at the CodeBehind then use ASP control. Else it's good to use HTML control

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bubbly on: 2/7/2010 [Member] Bronze

Up
0
Down
Its good to use HTML controls

++
Thanks & Regards,
Deepika

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 2/13/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
If you have nothing to deal with ViewState, I think it is better to avoid aspx controls.

Use simple html table, for your layout.

To show data, you might consider DataGrid. If you still want lesser ViewState, use Repeater or ListView to design your own data layout.

:) :)

www.abhisheksur.com

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Up
0
Down
In asp table you can set enableviewstate=false if you dont need it. So both are same in a way.

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response