Professional ASP.NET 3.5 in C# and Visual Basic Part 75

Professional in C# and Visual Basic Part 75. Building on the revolutionary release, 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 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 14 Site Navigation AddingStyles to Dynamic Items Adding styles to the dynamic items of the menu control is just as easy as adding them to static items. The Menu control has a number of different elements for modifying the appearance of dynamic items including the following DynamicHoverStyle DynamicItemTemplate DynamicMenuItemStyle DynamicMenuStyle DynamicSelectedStyle These elements change menu items the same way as the static versions of these elements but they change only the items that dynamically pop-out from the static items. Listing 14-19 shows an example of applying the hover style to dynamic items. Listing 14-19 Adding a hover style to dynamic items in the menu control asp Menu ID Menu1 runat server DataSourceID Sitemapdatasource1 StaticHoverStyle BackColor DarkGray BorderColor Black BorderStyle Solid BorderWidth 1 StaticHoverStyle DynamicHoverStyle BackColor DarkGray BorderColor Black BorderStyle Solid BorderWidth 1 DynamicHoverStyle asp Menu This code produces the results shown in Figure 14-22. Figure 14-22 697 Chapter 14 Site Navigation Changing the Layout of the Menu Items By default the dynamic menu items are displayed from left to right. This means that as the items in the menu expand they are continually displayed in a vertical fashion. You can actually control this behavior but another option is available to you. The other option is to have the first level of menu items appear directly below the first static item horizontally . You change this behavior by using the Orientation attribute of the Menu control as shown in Listing 14-20. Listing 14-20 Forcing the menu items to use a horizontal orientation asp Menu ID Menu1 runat server DataSourceID SiteMapDataSource1 Orientation Horizontal asp Menu This code produces the results shown in Figure 14-23. Figure 14-23 The Orientation attribute can take a value of Horizontal or Vertical only. The default value is Vertical. Changing the Pop-Out Symbol As the default an arrow is used as the pop-out .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
15    70    1    17-05-2024
Đã 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.