Báo cáo tài liệu vi phạm
Giới thiệu
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
THỊ TRƯỜNG NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
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
NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
Thông tin
Tài liệu Xanh là gì
Điều khoản sử dụng
Chính sách bảo mật
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
ASP.NET 4 Unleased - p 44
Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 44
Trí Hữu
106
10
pdf
Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG
Tải xuống
Using the SqlDataSource Control FIGURE 9.8 Canceling a command when a field is blank. LISTING 9.14 CancelCommand.aspx /// /// Iterate through all parameters and check for null /// protected void srcMovies_Updating(object sender, SqlDataSourceCommandEventArgs e) { foreach (SqlParameter param in e.Command.Parameters) if (param.Value == null) { e.Cancel = true; lblError.Text = “All fields are required!”; } } From the Library of Wow! eBook Executing Database Commands 405 .error { display:block; color:red; font:bold 16px Arial; margin:10px; } td,th { padding:10px; } Cancel Command. | 404 CHAPTER 9 Using the SqlDataSource Control All fields are required Caiegorvld Director James Cameron DateReleased 6 21 1997 llOftOOAM 345678910 FIGURE 9.8 Canceling a command when a field is blank. LISTING 9.14 CancelCommand.aspx @ Page Language C @ Import Namespace System.Data.SqlClient DOCTYPE html PUBLIC - W3C DTD XHTML 1.1 EN http www.w3.org TR xhtml11 DTD xhtml11.dtd script runat server summary Iterate through all parameters and check for null summary protected void srcMovies_Updating object sender SqlDataSourceCommandEventArgs e foreach SqlParameter param in e.Command.Parameters if param.Value null e.Cancel true lblError.Text All fields are required script html xmlns http www.w3.org 1999 xhtml head id Head1 runat server From the Library of Wow eBook Executing Database Commands 405 style type text css .error display block color red font bold 16px Arial margin 10px td th padding 10px style title Cancel Command title head body form id form1 runat server div asp Label id lblError EnableViewState false CssClass error Runat server asp DetailsView id dtlMovie DataSourceID srcMovies DataKeyNames Id AllowPaging true AutoGenerateEditButton true Runat server asp SqlDataSource id srcMovies SelectCommand SELECT FROM Movies UpdateCommand UPDATE Movies SET Title @Title Director @Director DateReleased @DateReleased WHERE Id @id ConnectionString ConnectionStrings Movies Runat server OnUpdating srcMovies_Updating div form body html 9 From the Library of Wow eBook 406 CHAPTER 9 Using the SqlDataSource Control The page in Listing 9.14 includes a srcMovies_Updating method. In this method each parameter associated with the update command is compared against the value Nothing null . If one of the parameters is null an error message displays in a Label control. Using ASP.NET Parameters with the SqlDataSource Control You can use any of the following ASP.NET Parameter objects with the SqlDataSource control Parameter Represents an arbitrary static value. ControlParameter Represents
TÀI LIỆU LIÊN QUAN
Đã 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.