tailieunhanh - BeginningASP.NET 2.0 with C# PHẦN 4

Bằng cách giữ cùng một màu sắc, logo, và bố trí trên màn hình, bạn phát triển một cảm giác về sự hiện diện. Trung thành theo Lưu ý rằng nếu bạn cố gắng để thực sự xóa một nhân vật, bạn sẽ nhận được một thông báo lỗi. Nhiều khía cạnh khác của trang web dựa trên danh sách các đồ đạc, | Events and Code Inserting Inserted and for data being deleted Deleting Deleted . The present tense event Inserting for example is raised as the action is occurring whereas the past tense event such as Deleted is raised after the event. For example when deleting a row the Deleting event is raised just before the row is deleted and the Deleted event is raised after the event is raised. For some events the fact that they are raised before the actual action takes place gives you the opportunity to cancel the event. For example consider the file where the team owner can change the squad. One of the things the owner wants is to make sure that any players that left during the playing season remain in the database so you can t delete players between August 20 and May 31. To enable this you need to allow deletion of players but not within those dates. Give this a go in the next Try It Out. Try It Out Canceling Events 1. Open the file in the Visual Web Developer designer and add a Label control at the very end of the page. 2. Set the ID of the Label control to Message and clear the Text property. 3. Select the DetailsDataSource control and on the events list double-click into the box next to the Deleting event to have the event procedure created for you. 4. In the empty event procedure add the following code DateTime today int startYear int endYear DateTime seasonStart DateTime seasonEnd if 5 startYear endYear 1 else startYear - 1 endYear seasonStart new DateTime startYear 8 20 20th August seasonEnd new DateTime endYear 5 31 31st May if today seasonStart today seasonEnd true Cannot delete players during the season else 197 Chapter 6 5. Save the file and from the right mouse menu select View in Browser. 6. Make sure your system date is set between August 20 and May 31. 7. Select a player and try to delete him. You ll see a .

crossorigin="anonymous">
Đã 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.