Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Professional ASP.NET 3.5 in C# and Visual Basic Part 32. Building on the revolutionary ASP.NET 2.0 release, ASP.NET 3.5 adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in ASP.NET 2.0 now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 6 Themes and Skins Figure 6-2 From here you can see that everything including the font font color text box button and more has changed appearance. If you have multiple pages you may find that it is nice not to have to think about applying styles to everything you do as you build because the styles are already centrally defined for you. Applying a Theme to an Entire Application In addition to applying an ASP.NET theme to your ASP.NET pages using the Theme attribute within the Page directive you can also apply it at an application level from the web.config file. This is illustrated in Listing 6-2. Listing 6-2 Applying a theme application-wide from the web.config file xml version 1.0 configuration system.web pages theme SmokeAndGlass system.web configuration If you specify the theme in the web.config file you do not need to define the theme again in the Page directive of your ASP.NET pages. This theme is applied automatically to each and every page within your application. If you wanted to apply the theme to only a specific part of the application in this fashion then you can do the same but in addition make use of the --location element to specify the areas of the applications for which the theme should be applied. 265 Chapter 6 Themes and Skins Removing Themes from Server Controls Whether themes are set at the application level or on a page at times you want an alternative to the theme that has been defined. For example change the text box server control that you have been working with from Listing 6-1 by making its background black and using white text asp Textbox ID TextBox1 runat server BackColor 000000 ForeColor ffffff The black background color and the color of the text in the text box are specified directly in the control itself with the use of the BackColor and ForeColor attributes. If you have applied a theme to the page where this text box control is located however you will not see this black background or white text because these changes are .