tailieunhanh - microsoft visual c 2008 step by step phần 10

Tất cả các quyền. Không có phần nào của cuốn sách này có thể được sao chép, lưu trữ trong một hệ thống thu hồi, hoặc truyền đi dưới bất kỳ hình thức nào hoặc bằng bất cứ phương tiện nào, mà không cần sự cho phép trước bằng văn bản của nhà xuất bản, ngoại trừ trong trường hợp các trích dẫn ngắn gọn | Chapter 27 Introducing 577 4. Add a method called initPositionRole to the-Default class after the Page_Load method private void initPositionRoleO You will invoke this method to initialize the positionRole drop-down list to its default set of values. 5. Add the following statements shown in bold type to the initPositionRole method private void initPositionRoleO true Analyst Designer Developer The first statement clears the items from the drop-down list box. The second statement activates the list box. You will write some code shortly that disables it under certain circumstances. The remaining statements add the three roles that are applicable to workers. 6. Add the statements shown here in bold type to the Page_Load method protected void Page_Load object sender EventArgs e if IsPostBack initPositionRole This block of code causes the positionRole drop-down list to be populated when the form appears in the user s browser. However it is important to understand that the Page_Load method runs every time the Web server sends the form to the user s browser. For example when the user clicks a button the form can be sent back to the Web server for processing the Web server then responds by sending the form back to the browser for displaying when the processing has completed. You don t want the initialization to be performed every time the page appears because it is a waste of processing and can lead to performance problems if you are building a commercial Web site. You can determine whether the Page_Load method is running because this is the first time the page is being displayed by querying the IsPostBack property of the Web page. This property returns false the first time the page is displayed and true if the page is being redisplayed because the user has clicked a control. In the code you added you call the initPositionRole method only when the form .

TỪ KHÓA LIÊN QUAN
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.