Đang chuẩn bị liên kết để tải về tài liệu:
ASP.NET 4 Unleased - p 64

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Sử dụng Control FormView Bạn có thể sử dụng kiểm soát FormView để làm bất cứ điều gì mà bạn có thể làm với các điều khiển DetailsView. Cũng như bạn có thể với sự kiểm soát DetailsView, bạn có thể sử dụng kiểm soát FormView để hiển thị, trang, chỉnh sửa, chèn, và xóa các bản ghi cơ sở dữ liệu. | 604 CHAPTER 12 Using the DetailsView and FormView Controls GridLines None HeaderText Movies CssClass movies HeaderStyle-CssClass header FieldHeaderStyle-CssClass fieldHeader AlternatingRowStyle-CssClass alternating CommandRowStyle-CssClass command PagerStyle-CssClass pager Runat server asp SqlDataSource id srcMovies ConnectionString ConnectionStrings Movies SelectCommand SELECT Title Director InTheaters FROM Movies InsertCommand INSERT Movies Title Director InTheaters VALUES @Title @Director Runat server div form body html Using the FormView Control You can use the FormView control to do anything that you can do with the DetailsView control. Just as you can with the DetailsView control you can use the FormView control to display page edit insert and delete database records. However unlike the DetailsView control the FormView control is entirely template-driven. I use the FormView control much more than the DetailsView control. The FormView control provides you with more control over the layout of a form. Furthermore adding validation controls to FormView is easier than adding validation controls to a DetailsView control. WEB STANDARDS NOTE By default the FormView control renders an HTML table. It creates an HTML table that contains a single cell. In ASPNET 4 you can disable this by setting the RenderOuterTable property to False. This enables you to style the output using CSS styles. From the Library of Wow eBook Using the FormView Control 605 Displaying Data with the FormView Control You can display a database record with the FormView control by using an ItemTemplate. For example the page in Listing 12.19 displays a record from the Movies database table see Figure 12.13 . FIGURE 12.13 Displaying a database record with the FormView control. LISTING 12.19 ShowFormView.aspx 12 @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML 1.1 EN http www.w3.org TR xhtml11 DTD xhtml11.dtd html xmlns http www.w3.org 1999 xhtml head id Head1 runat server style type text css html

TÀI LIỆU LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.