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

Professional in C# and Visual Basic Part 47. 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 Listing 8-27 Building the EmptyltemTemplate EmptyDataTemplate table runat server style background-color FFFFFF border-collapse collapse border-color 999999 border-style none border-width 1px tr td No data was returned. td tr table EmptyDataTemplate Creating the InsertItemTemplate The last section looked at here is the InsertItemTemplate. This section allows you to define how a form should be laid out for inserting data similar to that used in the ItemTemplate into the data store. Listing 8-28 shows an example of the InsertItemTemplate. Listing 8-28 Building the InsertItemTemplate InsertItemTemplate tr style td asp Button ID InsertButton runat server CommandName Insert Text Insert asp Button ID CancelButton runat server CommandName Cancel Text Clear td td asp TextBox ID CustomerIDTextBox runat server Text Bind CustomerID td td asp TextBox ID CompanyNameTextBox runat server Text Bind CompanyName td td asp TextBox ID ContactNameTextBox runat server Text Bind ContactName td tr InsertItemTemplate The Results After you have created an additional AlternatingItemTemplate that is the same as the ItemTemplate but styled differently you can then run the page. Then you will be presented with your own custom grid. An example is presented in Figure 8-9. 416 Chapter 8 Data Managementwith Figure 8-9 Figure 8-10 417 Chapter 8 Data Managementwith From this figure you can see that all your defined elements are in place. The header is defined through the use of the LayoutTemplate. The items in the grid are defined through the use of the ItemTemplate. The AlternatingItemTemplate the insert form is defined through the use of the InsertTemplate. The page navigation is defined by the new DataPager server control. Again the DataPager control is defined within the LayoutTemplate itself. Editing items in this template is as simple as clicking on the Edit button. This will change the view to the EditTemplate for the selected item as .

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.