Beginning Microsoft Visual C# 2008 PHẦN 6

thực hiện thêm các mục quá nhiều vào bộ sưu tập, hoặc nếu Danh sách thông qua các nhà xây dựng có chứa quá nhiều chương này, bạn tiếp tục khám phá ngôn ngữ C # bằng cách nhìn vào một vài bit và miếng đã không hoàn toàn phù hợp với những nơi khác. Điều này không phải là để nói rằng những kỹ thuật này không hữu ích - chỉ là | Chapter 19 Basic Web Programming The label labelResult again has a Text property where the result is set 0 1 selected the event 2 firstName lastName selectedEvent Instead of displaying the results on the same page makes it easy to display the results in a different page as shown in the following Try It Out. Try It Out Displaying the Results in a Second Page 1. Create a new WebForm with the name . 2. Add a label to the ResultsPage with the name labelResult. 3. Add code to the Page_Load method to the class _ResultsPage as shown here public partial class _ResultsPage protected void Page_Load object sender EventArgs e try DropDownList dropDownListEvents DropDownList dropDownListEvents string selectedEvent string firstName TextBox textFirstName .Text string lastName TextBox textLastName .Text string email TextBox textEmail .Text 0 1 selected the event 2 firstName lastName selectedEvent catch The originating page must contain textFirstName textLastName textEmail controls 4. Set the page s Submit button s PostbackUrl property to . 639 Part III Web Programming 5. You can remove the Click event handler of the Submit button because it is not required anymore. 6. Start the page fill in some data and click the Submit button. You are redirected to the page where the entered data is displayed. How It Works With the Button control implements the property PostbackUrl to define the page that should be requested from the Web server. This property creates client-side JavaScript code to request the defined page with the client-side onclick handler of the Submit button input type submit name buttonSubmit value Submit onclick javascript webForm_DoPostBackWithOptions new

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
18    96    1    27-04-2024
Đã 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.