Use a Single Web Form to Update Multiple Lookup Tables

Sử dụng mẫu đơn Web để cập nhật nhiều Lookup Bàn Như với hướng dẫn thứ hai (8,2), ví dụ này sẽ cho bạn thấy làm thế nào để cập nhật các bảng tra cứu nhiều, thời gian này bằng cách sử dụng một mẫu Web. | Use a Single Web Form to Update Multiple Lookup Tables As with the second tutorial this example will show you how to update multiple lookup tables-this time using a Web Form. Creating a Web Form for viewing multiple lookup tables would take about the same if not less code than performing the same task using the Windows Form. Updating adding and deleting data takes a bit more work though. This How-To will show you how to accomplish this task by using the DataGrid control and show you how to take advantage of Session variables and paging within the data grid when you re manipulating data. Technique The DataGrid control is a powerful control as you saw in Chapter 5 Working with Data on Web Forms but when programming in Web Forms it takes some getting used to. Because the Web Forms are stateless you need to keep reminding the data grid what it is bound to. Also even though you declare a variable at the module level behind the form you will notice that whenever the form goes back to the server for information you lose the values of your variables. The workaround for this is the use of the Session object. Note A full discussion of State management in .NET and the various options is presented in Chapter 5. This also includes how to use the options for the data grid manipulation portion of this How-To. The other major issue with this How-To is managing the paging of the DataGrid control covered in Chapter 4. You will quickly learn the steps of creating the Web Form that allows users to update Lookup tables. Steps Open and run the -Chapter 8 solution. From the main Web Form click on the hyperlink with the caption How-To Use a Single Web Form for Updating Multiple Lookup Tables. Click on the first choice Categories in the list box labeled Lookup Table to Edit. The data grid will then appear. The grid will be filled in with the data of the table you chose. Your page will then look like the page displayed in Figure . Figure . On this page you can add .

Không thể tạo bản xem trước, hãy bấm tải xuống
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.