TAILIEUCHUNG - ASP.NET 4.0 in Practice phần 6

Thư viện Microsoft Anti-XSS là một sự kết hợp các chức năng bảo vệ ứng dụng web. Bạn có thể tự do tải về tại . Tại thời điểm viết bài này, Anti-XSS thư viện có sẵn trong phiên bản 4. Phiên bản 3 đã giới thiệu tính năng mới, và nó được viết lại hoàn toàn với hiệu suất trong tâm trí. | TECHNIQUE 52 Building customized data templates 225 Figure Although Title and Text are both strings we need EditorFor to produce different templates because each has a different business meaning. Listing Marking property type with UIHintAttribute C public class PostMetadata DataType public string Text get set UIHint Author public int AuthorId get set MetadataType typeof PostMetadata public partial class Post VB Public Class PostMetadata DataType Public Property Text As String UIHint Author Public Property AuthorId As Integer End Class MetadataType GetType PostMetadata Partial Public Class Post End Class A Standard data Y type definition A Custom data Y type definition Metadata type reference A Standard data Y type definition A Custom data Y type definition Metadata type reference When it comes across properties marked like those at o and A the MVC view engine looks in the Shared View folder for data templates that have the same names. If it finds any such templates it renders them. DISCUSSION Modern development platforms provide features that help us build consistent and maintainable UIs. Web Forms for example uses the abstraction of custom server controls to let the developer build discrete and reusable interface portions. MVC provides a different model called data templates which is based on the data type you want to represent or edit in your page. Anytime you realize there s a particular object among your models that appears many times in many pages and you 226 Chapter 9 Customizing and extending TECHNIQUE 53 want to componentize how it gets displayed or how its editor looks when it s placed in a form reach for a custom data template. Think about how many times you ve built a drop-down list to let the user choose a customer. It doesn t matter whether that user is going to associate it with an order or an invoice a property of type Customer is always going to be there to fill .

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.