Bài giảng Lập trình ứng dụng Web - Chương 3: HTML Server control và Web Server Control

66 16 0
Bài giảng Lập trình ứng dụng Web - Chương 3: HTML Server control và Web Server Control

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Bài giảng Lập trình ứng dụng Web - Chương 3: HTML Server control và Web Server Control trình bày các nội dung chính sau: HTML control, hệ thống thứ bậc của HTML Server Controls, các sự kiện (event) của HTML server Control, cách lấy dữ liệu từ các HTML server,... Mời các bạn cùng tham khảo để nắm nội dung chi tiết.

CHƯƠNG III: HTML SERVERCONTROL VÀ WEB SERVER CONTROL Lý thuyết tiết Thực hành 6tiết I HTML Server Control  Các HTML control thông thường , , không xử lý server mà gửi trực tiếp cho browser để hiển thị  Các HTML control xử lý phía server cách chuyển chúng thành HTML server control I   HTML Server Control Chuyển HTML control thành HTML server control cách thêm thuộc tính runat=”server” vào tag HTML Cú pháp: Ví dụ: I HTML Server Control  Tất HTML Server Control phải đặt tag với thuộc tính runat = “server”  HTML Server Control tồn bên không gian tên System.Web.UI.HtmlControls  Hệ thống thứ bậc HTML Server Controls System.Object System.Web.UI.Control HtmlControl HtmlImage HtmlContainerControl HtmlForm HtmlInputControl HtmlInputFile , HtmlGenericControl , HtmlInputHidden HtmlSelect HtmlInputImage HtmlTable HtmlInputRadioButton HtmlInputText HtmlInputButton HtmlInputCheckBox HtmlTableCell , HtmlTableRow HtmlTextArea HtmlAnchor HtmlButton I HTML Server Control Các kiện (event) HTML server Control:  onServerClick  onServerChange  onStartSelect,… Cú pháp:   Lưu ý: Function khơng có tham số I HTML Server Control Ví dụ: I  HTML Server Control Cách lấy liệu từ HTML server Cú pháp: controlfield_id.Value  Đối với tag DIV, SPAN dùng thuộc tính innerHTML I HTML Server Control Ví dụ: public void btnSend_ServerClick(object sender,System.EventArgs e) { String strName; strName=txtName.Value; Response.Write(“Hello :”+strName) } Ví dụ void Button_ServerClick(object sender, EventArgs e) { MySpan.InnerHtml = “Chao ban : " + myText.Value + "."; } V Validation Server Control  Thuộc tính:  minimumValue, maximumValue: khoảng giới hạn giá trị nhập liệu  ControlToValidate: chứa ID control khác form để kiểm tra giới hạn nhập liệu  Display: có giá trị none, static, dynamic Chọn kiểu thể thông báo V Validation Server Control RegularExpressionValidator Server Control: kiểm tra liêu nhập với khuôn biểu thức mẫu (RegularExpression) định nghĩa trước Visual Studio NET cung cấp khuôn biểu thức mẫu:  Telephone numbers  Postal codes  E-mail addresses V Validation Server Control  Thuộc tính: ValidationExpression: Khung biểu thức mẫu để so sánh kiểm tra  Cú pháp: * V Validation Server Control CompareValidator Server Control: So sánh liệu nhập với trị control khác cho trước thiêt kế giá trị liệu Các phép toán so sánh >,>=,

Ngày đăng: 08/05/2021, 17:27

Mục lục

  • CHƯƠNG III: HTML SERVERCONTROL VÀ WEB SERVER CONTROL

  • Hệ thống thứ bậc của Web Server Control

  • //hàm ServerVerify kiểm tra trên server

Tài liệu cùng người dùng

Tài liệu liên quan