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

Professional in C# and Visual Basic Part 46. 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 8 Data Managementwith span id DataList1_ctl00_CompanyNameLabel Alfreds Futterkiste span br br td tr tr td CompanyName span id DataList1_ctl01_CompanyNameLabel Ana Trujillo Emparedados y helados span br br td tr -- Code removed for clarity -- table Although this table layout is the default you can change this so that the DataList control outputs span tags instead. This is done through the use of the RepeatLayout property of the DataList control. You will need to rework your DataList as is shown in Listing 8-19. Listing 8-19 Changing the output style using RepeatLayout asp DataList ID DataList1 runat server DataSourceID SqlDataSource1 RepeatLayout Flow ItemTemplate Company Name asp Label ID CompanyNameLabel runat server Text Eval CompanyName br br ItemTemplate asp DataList The possible options for the RepeatLayout property are either Table or Flow. Table is the default setting. The output you will get when looking at the source of the page when using the Flow setting is presented here span id DataList1 span CompanyName span id DataList1_ctl00_CompanyNameLabel Alfreds Futterkiste span br br span br span CompanyName span id DataList1_ctl01_CompanyNameLabel Ana Trujillo Emparedados y helados span br br span 406 Chapter 8 Data Managementwith -- Code removed for clarity -- span Working with Other Layout Templates You will find that the other templates are just as easy to work with as the ItemTemplate. Listing 8-20 shows you how to add the AlternatingItemTemplate and the SeparatorTemplate to the company name display. Listing 8-20 Using both the AlternatingItemTemplate and the SeparatorTemplate @ Page Language VB AutoEventWireup false CodeFile Inherits DataListControl html xmlns http 1999 xhtml head runat server title DataList Control title head body form id form1 runat server div asp DataList ID DataList1 runat server DataSourceID SqlDataSource1 ItemTemplate Company Name asp Label ID CompanyNameLabel runat server .

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
Đã 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.