aspnet sample_part8

Chương 4: Các hình thức web và Điều khiển Web C # void Click (Object s, EventArgs e) { = "Hello World";} HtmlTextArea Việc kiểm soát HtmlTextArea tạo ra một phiên bản máy chủ của thẻ. | Chapter 4 Web Forms and Web Controls C script runat server language C void Click Object s EventArgs e Hello WOrld script HtmlTextArea The HtmlTextArea control creates a server-side version of the textarea tag. textarea cols 60 rows 10 runat server textarea We ve glanced only briefly over the HTML controls as they should all be fairly familiar from your experience with HTML. But if you d like more information on the HTML controls including the properties methods and events for each see Appendix A. Processing a Simple Form Now that you have a basic understanding of page structure the languages and C and HTML controls let s put everything together and create a simple application. The application that we will create in and C will be a simple survey form that uses the following HTML controls HtmlForm HtmlButton HtmlInputText HtmlSelect Let s begin by creating a new file within your favorite code editor. The following code creates the visual interface for the survey File excerpt html head head 94 ThiSk 1 She tn _aljn of ersion all 700 pages Processing a Simple Form body form runat server h2 Take the Survey h2 p Name br input type text id txtName runat server p p Email br input type text id txtEmail runat server p p Which server technologies do you use br select id servermodel runat server multiple true option option option PHP option option JSP option option CGI option option Coldfusion option select p p Do you like .NET so far br select id likedotnet runat server option selected Yes option option No option select p p button id myButton OnServerClick Click runat server Confirm button p form body html From what we ve already covered on HTML controls you should have a good idea of what this page will look like. All we ve done is place some HtmlInputText controls an HtmlButton control and an HtmlSelect control inside the obligatory HtmlForm control. Remember HTML controls are essentially

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
16    80    2    07-06-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.