TAILIEUCHUNG - ASP.NET 2.0 DEMYSTIFIED phần 5

Thông tin này được tạo ra bởi các công cụ bằng cách sử dụng các dữ liệu sản phẩm được lưu trữ trong một cơ sở dữ liệu. Một khi bạn thực hiện một danh sách các thông tin này, sau đó thiết kế giao diện người dùng. | CHAPTER 5 Conditional Statements Figure 5-6 The visitor is prompted to enter a starting value for the count. 3. The engine then declares an Integer variable called i. 4. The For loop is then entered. The start number that the visitor entered is a string data type see Chapter 4 . The For loop requires an Integer value. Therefore the engine is told to convert the start number to an integer using the CInt conversion function that you learned about in Chapter 4. 5. The engine adds 1 to the variable until the value of the variable equals 10 at which time it breaks out of the For loop. Notice there is no need to insert statements within the For loộp because we re only interested in the final value of the variable. 6. The Enabled property of the StartValue text box is set to false so that the visitor cannot change this value. 7. The visible properties of the Result label and the Resultvalue are set to true so that the visitor can see these objects. 8. The value of the variable is then placed into the Resultvalue text box. Remember that the Result Value text box needs a string and that the variable is an Integer. Therefore we use the CStr conversion function to change the Integer to a string before placing it into the text box. Demystified Figure 5-7 If the visitor enters 1 as the start value the displays 11 as the result. 9. The Enabled property of the ResutlValue text box is set to false so that the visitor cannot change this value. Figure 5-7 shows the web page after the visitor enters 1 as the starting value. script runat server Sub Count-Click ByVai sender As Object ByVai e As Dim i As Integer For i CInt To 10 Next I False Result-Visible True True cstr i False End Sub script html head head body CHAPTER 5 Conditional Statements form id Forml runat server p asp Label id Labell runat server width 92px start Value asp .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.