TAILIEUCHUNG - ASP.NET 4 Unleased - p 10

Khi bạn cung cấp một điều khiển Label với một tài sản AssociatedControlID, điều khiển Label là ra như là một tag HTML thay vì một tag HTML . Ví dụ, nếu bạn chọn View Source trên trình duyệt web của bạn, bạn thấy rằng các nhãn đầu tiên trong danh mục 2,3 làm cho nội dung sau đây để trình duyệt: | 64 CHAPTER 2 Using the Standard Controls title Label Form title head body form id form1 runat server div asp Label id lblFirstName Text First Name AssociatedControlID txtFirstName Runat server br asp TextBox id txtFirstName Runat server br br asp Label id lblLastName Text Last Name AssociatedControlID txtLastName Runat server br asp TextBox id txtLastName Runat server div form body html When you provide a Label control with an AssociatedControlID property the Label control is rendered as an HTML label tag instead of an HTML span tag. For example if you select View Source on your web browser you see that the first Label in Listing renders the following content to the browser label for txtFirstName id lblFirstName First Name label Always use a Label control with an AssociatedControlID property when labeling form fields. This is important when you need to make your website accessible to persons with disabilities. If someone uses an assistive device such as a screen reader to interact with your website the AssociatedControlID property enables the assistive device to associate the correct label with the correct form field. From the Library of Wow eBook Displaying Information 65 A side benefit of using the AssociatedControlID property is that clicking a label when this property is set automatically changes the form focus to the associated form input field. WEB STANDARDS NOTE Both the WCAG and Section 508 accessibility guidelines require you to use the label for tag when labeling form fields. For more information see http . org wai and http . 2 Using the Literal Control The Literal control is similar to the Label control. You can use the Literal control to display text or HTML content in a browser. However unlike the Label control the Literal control does not render its content inside of a span tag. For example the page in Listing uses a Literal control in the page s head tag to dynamically modify the title displayed in the browser .

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.