mcts 70-562 Microsoft .NET Framework 3.5, ASP.NET Application Development phần 2

Hai loại điều khiển máy chủ Web Button có thể được tạo ra là gì? 2. Làm thế nào để bạn tạo một TextBox để lấy mật khẩu từ một người sử dụng? 3. Làm thế nào để bạn thực hiện một CheckBox gây PostBack ngay lập tức đến máy chủ? | FIGURE 2-16 Defining properties of the RadioButton control on a Web page Quick Check 1. What are the two types of Web server Button controls that can be created 2. How do you create a TextBox for retrieving a password from a user 3. How do you make a CheckBox cause immediate PostBack to the server Quick Check Answers 1. The two types of Web server Button controls are submit and command buttons. 2. You can mask the user s entered password by setting the TextMode property of the TextBox control to Password. 3. You can force an immediate PostBack for a CheckBox control by setting its Auto-PostBack property to true. LAB Working with Web Server Controls In this lab you work with the Web server controls that are defined in this chapter. If you encounter a problem completing an exercise the completed projects are available on the companion CD in the Code folder. Lesson 2 Exploring Common Server Controls CHAPTER 2 79 EXERCISE 1 Adding Controls to the Web Page In this exercise you add Web server controls to a Web page. 1. Open Visual Studio and create a new Web site called WebServerControls. 2. Open the Web page in Design view. 3. Drag a Label CheckBox TextBox three RadioButtons and a Button control onto the Web page. Change the Text properties of these controls to match Figure 2-17. In addition name these items Labelinformation CheckBoxAdmin TextBoxUser- Name RadioButtonl RadioButton2 RadioButton3 and ButtonSave respectively. Also set the GroupName for the radio buttons to ApplicationRole. FIGURE 2-17 Drag Web server controls onto the page as shown 4. Right-click the Web page and select View Code to open the code-behind page. Notice that no additional code was added to the code-behind page. 5. Run the Web application. Click the Button CheckBox and RadioButton controls. Observe the behavior of these controls. Notice that the Button is the only control that performs a PostBack to the server. Also notice that the RadioButton controls are not mutually exclusive. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
17    96    2    23-05-2024
42    515    21    23-05-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.