Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 14

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Hiển thị hình ảnh Khung bao gồm hai điều khiển ASP.NET để hiển thị hình ảnh: Hình ảnh và Imagemap. Việc kiểm soát hình ảnh đơn giản chỉ hiển thị một hình ảnh. Việc kiểm soát Imagemap cho phép bạn tạo một máy khách, có thể click được, hình ảnh bản đồ. | 104 CHAPTER 2 Using the Standard Controls FIGURE 2.15 Handling the Command event. Displaying Images The ASP.NET Framework includes two controls for displaying images Image and ImageMap. The Image control simply displays an image. The ImageMap control enables you to create a client-side clickable image map. Using the Image Control The page in Listing 2.26 randomly displays one of three images. The image is displayed by setting the ImageUrl property of the Image control contained in the body of the page. LISTING 2.26 ShowImage.aspx @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML 1.0 Transitional EN http www.w3.org TR xhtml1 DTD xhtml1-transitional.dtd script runat server void Page_Load Random rnd new Random switch rnd.Next 3 From the Library of Wow eBook Displaying Images 105 case 0 imgRandom.ImageUrl Picture1.gif imgRandom.AlternateText Picture 1 break case 1 imgRandom.ImageUrl Picture2.gif imgRandom.AlternateText Picture 2 break case 2 imgRandom.ImageUrl Picture3.gif imgRandom.AlternateText Picture 3 break script html xmlns http www.w3.org 1999 xhtml head id Head1 runat server title Show Image title head body form id form1 runat server div 2 asp Image id imgRandom Runat server div form body html The Image control supports the following properties this is not a complete list AlternateText Enables you to provide alternate text for the image required for accessibility . DescriptionUrl Enables you to provide a link to a page that contains a detailed description of the image required to make a complex image accessible . GenerateEmptyAlternateText Enables you to set the AlternateText property to an empty string. From the Library of Wow eBook 106 CHAPTER 2 Using the Standard Controls ImageAlign Enables you to align the image relative to other HTML elements in the page. Possible values are AbsBottom AbsMiddle Baseline Bottom Left Middle NotSet Right TextTop and Top. ImageUrl Enables you to specify the URL to the image. The Image control supports three methods for .

TÀI LIỆU LIÊN QUAN
crossorigin="anonymous">
Đã 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.