tailieunhanh - ASP.NET 4 Unleased - p 31
Designing Websites with Themes LISTING Show Named Skin When you open the page in Listing , the first TextBox appears with a dashed border, and the second TextBox appears with a double border (see Figure ). From the Library of Wow! eBook Adding Skins to Themes 275 FIGURE 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 @ Page Language C Theme Simple2 DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD html xmlns http 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 the first TextBox appears with a dashed border and the second TextBox appears with a double border see Figure . From the Library of Wow eBook Adding Skins to Themes 275 6 FIGURE 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 . LISTING Simple3 asp Label BackColor Orange Runat Server The Skin in Listing sets the background color of all Label controls to the color Orange. Now image that you apply the Skin in Listing to the page in Listing . From the Library of Wow eBook 276 CHAPTER 6 Designing Websites with Themes LISTING @ Page Language C Theme Simple3 DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD html xmlns http 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 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 .
đang nạp các trang xem trước