TAILIEUCHUNG - ASP.NET 4 Unleased - p 40

Trong phiên bản , bạn phải sử dụng () khi dữ liệu hiển thị các mục trong mẫu. Tuy nhiên, Microsoft đã tiếc về lập trình sau khi và cung cấp cho chúng tôi với cú pháp ngắn hơn. | 364 CHAPTER 8 Overview of Data Access FIGURE Using databinding expressions. In version you had to use when displaying data items in a template. However Microsoft took pity on programmers after and provided us with the shorter syntax. NOTE 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 Title The second DataBinding expression in Listing includes a second parameter. The Eval method optionally accepts a format string. You can use the format string to format values such as dates and currency amounts. In Listing the format string formats the DateReleased column as a long date. From the Library of Wow eBook Understanding Templates and DataBinding Expressions 365 NOTE Format strings use format specifiers such as the D format specifier when formatting strings. You can find a list of format specifiers by looking up Formatting Types in the index of the Microsoft .NET Framework SDK documentation. You can call other methods than the Eval method in a DataBinding expression. For example the DataBinding expression in Listing calls a method named FormatTitle to format the movie titles. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD script runat server public string FormatTitle Object title return b .ToUpper b script html xmlns http 1999 xhtml head id Head1 runat server title Format Movie Titles title head body form id form1 runat server div 8 asp Repeater id Repeater1 DataSourceId srcMovies Runat server ItemTemplate FormatTitle Eval Title hr ItemTemplate asp Repeater asp SqlDataSource id srcMovies .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.