Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 31
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Designing Websites with Themes LISTING 6.4 ShowNamedSkin.aspx Show Named Skin When you open the page in Listing 6.4, the first TextBox appears with a dashed border, and the second TextBox appears with a double border (see Figure 6.2). From the Library of Wow! eBook Adding Skins to Themes 275 FIGURE 6.2 Using Named Skins. 6 Themes Versus StyleSheetThemes When you apply a Theme to a page, the Skins in the Theme override any existing properties of the controls in the page. In other. | 274 CHAPTER 6 Designing Websites with Themes LISTING 6.4 ShowNamedSkin.aspx @ Page Language C Theme Simple2 DOCTYPE html PUBLIC - W3C DTD XHTML 1.1 EN http www.w3.org TR xhtml11 DTD xhtml11.dtd html xmlns http www.w3.org 1999 xhtml head runat server title Show Named Skin title head body form id form1 runat server div asp TextBox id txtFirstName SkinID DashedTextBox Runat server br br asp TextBox id txtLastName Runat server div form body html When you open the page in Listing 6.4 the first TextBox appears with a dashed border and the second TextBox appears with a double border see Figure 6.2 . From the Library of Wow eBook Adding Skins to Themes 275 6 FIGURE 6.2 Using Named Skins. Themes Versus StyleSheetThemes When you apply a Theme to a page the Skins in the Theme override any existing properties of the controls in the page. In other words properties in a Skin override properties in a page. For example imagine that you create the Skin in Listing 6.5. LISTING 6.5 Simple3 Label.skin asp Label BackColor Orange Runat Server The Skin in Listing 6.5 sets the background color of all Label controls to the color Orange. Now image that you apply the Skin in Listing 6.5 to the ASP.NET page in Listing 6.6. From the Library of Wow eBook 276 CHAPTER 6 Designing Websites with Themes LISTING 6.6 ShowSkinTheme.aspx @ Page Language C Theme Simple3 DOCTYPE html PUBLIC - W3C DTD XHTML 1.1 EN http www.w3.org TR xhtml11 DTD xhtml11.dtd html xmlns http www.w3.org 1999 xhtml head runat server title Show Skin Theme title head body form id form1 runat server div asp Label id Label1 Text What color background do I have BackColor red Runat server div form body html The page in Listing 6.6 includes a Label that has a BackColor property that is set to the value Red. However when you open the page the BackColor declared in the Skin overrides the BackColor declared in the page and the Label displays with an orange background. The default behavior of Themes makes it easy to modify the design of .