中继器、ListView、DataList、DataGrid、GridView……选择哪个? [英] Repeater, ListView, DataList, DataGrid, GridView ... Which to choose?

查看:29
本文介绍了中继器、ListView、DataList、DataGrid、GridView……选择哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这么多不同的控件可供选择!确定在 ASP.NET 中使用哪个控件显示数据的最佳做法是什么?

So many different controls to choose from! What are best practices for determining which control to use for displaying data in ASP.NET?

推荐答案

这真的是关于你想要达到的目标

It's really about what you trying to achieve

  • Gridview - 设计有限,像 html 表格一样工作.更多内置功能,如编辑/更新、页面、排序.很多开销.

  • Gridview - Limited in design, works like an html table. More in built functionality like edit/update, page, sort. Lots of overhead.

DataGrid - 旧版本的 Gridview.gridview 是一个超级数据网格.

DataGrid - Old version of the Gridview. A gridview is a super datagrid.

Datalist - Gridview 的更多可定制版本.也有一些开销.由于您必须自己设计,因此需要更多的手动工作.

Datalist - more customisable version of the Gridview. Also has some overhead. More manual work as you have to design it yourself.

ListView - 新的数据列表 :).几乎是 datalist 和 gridview 的混合体,您可以在其中使用分页和在 Gridview 中构建类似功能,但可以自由设计.此系列中的新控件之一

ListView - the new Datalist :). Almost a hybrid of the datalist and gridview where you can use paging and build in Gridview like functionality, but have the freedom of design. One of the new controls in this family

中继器 - 重量很轻.没有像页眉、页脚这样的内置功能.开销最少.

Repeater - Very light weight. No built in functionality like Headers, Footers. Has the least overhead.

这篇关于中继器、ListView、DataList、DataGrid、GridView……选择哪个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆