Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
ASP.NET 4 Unleased - p 18
Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 18
Thanh Sơn
136
10
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
ControlToValidate-ID của các trường biểu mẫu xác nhận. . Text-Các thông báo lỗi hiển thị khi xác nhận không thành công. . MinimumValue-Giá trị tối thiểu của dãy xác nhận. . MaximumValue-Giá trị tối đa phạm vi xác nhận. . Type-Các loại so với thực hiện. Giá trị có thể là String, Integer, Double, Date, và tiền tệ. Ví dụ, các trang trong Ví dụ 3,9 bao gồm một RangeValidator đó xác nhận một trường mẫu tuổi | 144 CHAPTER 3 Using the Validation Controls ControlToValidate The ID of the form field validated. Text The error message displayed when validation fails. Minimumvalue The minimum value of the validation range. Maximumvalue The maximum value of the validation range. Type The type of comparison to perform. Possible values are String Integer Double Date and Currency. For example the page in Listing 3.9 includes a RangeValidator that validates an age form field. If you do not enter an age between 5 and 100 a validation error displays see Figure 3.7 . LISTING 3.9 ShowRangeValidator.aspx @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML 1.0 Transitional EN http www.w3.org TR xhtml1 DTD xhtml1-transitional.dtd html xmlns http www.w3.org 1999 xhtml head id Head1 runat server title Show RangeValidator title head body form id form1 runat server div asp Label id lblAge Text Age AssociatedControlID txtAge Runat server asp TextBox id txtAge Runat server asp RangeValidator id reqAge ControlToValidate txtAge Text Invalid Age MinimumValue 5 MaximumValue 100 Type Integer Runat server br br asp Button From the Library of Wow eBook Using the RangeValidator Control 145 id btnSubmit Text Submit Runat server div form body html FIGURE 3.7 Validating a form field against a range of values. 3 If you submit the form in Listing 3.9 with an age less than 5 or greater than 100 the validation error message displays. The validation message also displays if you enter a value that is not a number. If the value entered into the form field cannot be converted into the data type represented by the RangeValidator control s Type property the error message displays. If you don t enter any value into the age field and submit the form no error message displays. If you want to require a user to enter a value you must associate a RequiredFieldValidator with the form field. Don t forget to set the Type property when using the RangeValidator control. By default the Type property has the value String and .
TÀI LIỆU LIÊN QUAN
crossorigin="anonymous">
Đã 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.