Chapter 8 Overview of Data Access
1. The GridView is bound to its data source only when the page is requested for the first time.
2. Every DataBound control included in the ASP.NET 3.5 Framework supports templates with the sole exception of the TreeView control. The Repeater, DataList, ListView, and FormView controls all require you to use templates. If you don’t supply a template, then these controls display nothing. The GridView, DetailsView, and Menu controls also support templates, but they do not require a template.
3. Technically, the Eval() method uses reflection when evaluating the data item to find a property with a certain name. You do pay a performance penalty when you use reflection. As an alternative, you can improve the performance of your DataBinding expressions by casting the data items to a particular type like this:
<%# ((System.Data.DataRowView)Container.DataItem)[“Title”] %>
4. One-way databinding: Text=’<%# Eval(“Title”) %>’
Two-way databinding: Text=’<%# Bind(“Title”) %>’
Templates that support one-way databinding implement the ITemplate interface.
Templates that support two-way databinding implement the IBindableTemplate interface.
Chpater 9 Using the SqlDataSource Control
1.
本文介绍了ASP.NET中数据绑定的基本概念和技术细节,包括GridView、Repeater等控件的数据绑定方式及模板使用,以及Eval()方法的性能优化技巧。此外还对比了一次性和双向数据绑定的区别。
1175

被折叠的 条评论
为什么被折叠?



