Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
. (Nhận xét của một nhà phát triển trên phiên bản trước của ASP.NET murach, được đăng trực tuyến) Đã biết làm thế nào để mã trong Visual Basic 2010? Sau đó, tổng thể lập trình web với phiên bản 4. NET của cuốn sách ASP.NETx | Chapter 2 How to develop a one-page web application 67 Common ASP.NET page events Event Procedure name Occurs when. Init Pagejnit A page is requested from the server. This event is raised before the view state of the page controls has been restored. Load Page_Load A page is requested from the server after all controls have been initialized and view state has been restored. This is the event you typically use to perform initialization operations such as retrieving data and initializing form controls. PreRender Page_PreRender All the control events for the page have been processed but before the HTML that will be sent back to the browser is generated. Common ASP.NET control events Event Occurs when. Click The user clicks a button link button or image button control. Textchanged The user changes the value in a text box. CheckedChanged The user selects a radio button in a group of radio buttons or selects or unselects a check box. SelectedlndexChanged The user selects an item from a list box a drop-down list a check box list or a radio button list. Code for the Click event of the btnClear button Protected Sub btnClear_Click ByVai sender As Object ByVai e As System.EventArgs Handles btnClear.Click ddlMonthlylnveatment.Text 50 txtlnterestRate.Text txtYears.Text IblFutureValue.Text End Sub Description All of the events associated with an ASP.NET web page and its server controls are executed on the server. Because of that the page must be posted back to the server to process any event for which you ve coded an event handler. When a page is posted back to the server the Init and Load events are always raised so any event handlers for those events are run first. Next the event handlers for any control events that were raised are executed in the order they were raised. When these event handlers finish the PreRender event is raised and any event handler for that event is run. Figure 2-18 How to use page and control events Download from Wow eBook www.wowebook.com 68 Section 1 .