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 170
Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 170
Quỳnh Sa
109
10
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Building Templated Databound Controls LISTING 37.8 ShowProductForm.aspx void Page_Load() { if (!Page.IsPostBack) { ProductForm1.Name = “Laptop”; ProductForm1.Price = 433.12m; ProductForm1.DataBind(); } } protected void ProductForm1_ProductUpdated(object sender, EventArgs e) { lblName.Text = ProductForm1.Results[“Name”].ToString(); lblPrice.Text = ProductForm1.Results[“Price”].ToString(); } Show ProductForm | 1664 CHAPTER 37 Building Templated Databound Controls LISTING 37.8 ShowProductForm.aspx @ Page Language C @ Register TagPrefix custom Namespace myControls DOCTYPE html PUBLIC - W3C DTD XHTML 1.0 Transitional EN http www.w3.org TR xhtml1 DTD xhtml1-transitional.dtd script runat server void Page_Load if IPage.IsPostBack ProductForml.Name Laptop ProductForml.Price 433.12m ProductForm1.DataBind protected void ProductForm1_ProductUpdated object sender EventArgs e lblName.Text ProductForm1.Results Name .ToString lblPrice.Text ProductForm1.Results Price .ToString script html xmlns http www.w3.org 1999 xhtml head id Head1 runat server title Show ProductForm title head body form id form1 runat server div custom ProductForm id ProductForm1 Runat server OnProductUpdated ProductForm1_ProductUpdated EditItemTemplate asp Label id lblName Text Product Name AssociatedControlID txtName Runat server asp TextBox id txtName From the Library of Wow eBook Creating Templated Controls 1665 Text Bind Name Runat server br br asp Label id lblPrice Text Product Price AssociatedControlID txtPrice Runat server asp TextBox id txtPrice Text Bind Price Runat server br br asp Button id btnUpdate Text Update Runat server EditItemTemplate custom ProductForm hr New Product Name asp Label id lblName Runat server br br New Product Price asp Label id lblPrice Runat server div form body html In the Page_Load method in Listing 37.8 the ProductForm Name and Price properties are set. Next the DataBind is called to cause the ProductForm control to evaluate its databinding expressions. The ProductForm control s EditItemTemplate includes Bind expressions instead of Eval expressions. You use Bind expressions in a two-way databinding template. From the Library of Wow eBook 1666 CHAPTER 37 Building Templated Databound Controls The EditItemTemplate includes a Button control. When you click the Button control the ProductForm control s OnBubbleEvent method executes the values are retrieved from the EditItemTemplate .
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.