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

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Sử dụng Fields HyperLink Bạn sử dụng HyperLinkField để tạo ra một liên kết đến một trang khác; HyperLinkField đặc biệt hữu ích khi bạn cần phải xây dựng hai trang Master / hình thức chi tiết. Ví dụ, các trang trong Ví dụ 11,22 hiển thị một danh sách các loại phim, và trang web trong Ví dụ 11,23 hiển thị một danh sách các bộ phim phù hợp với thể loại được chọn. | 534 CHAPTER 11 Using the GridView Control Using HyperLink Fields You use HyperLinkField to create a link to another page HyperLinkField is particularly useful when you need to build two page Master Detail forms. For example the page in Listing 11.22 displays a list of movie categories and the page in Listing 11.23 displays a list of movies that match the selected category. LISTING 11.22 Master.aspx @ Page Language C html xmlns http www.w3.org 1999 xhtml head id Head1 runat server title Master title head body form id form1 runat server div asp GridView id grdMovieCategories DataSourceID srcMovieCategories AutoGenerateColumns false Runat server Columns asp HyperLinkField HeaderText Movie Categories DataTextField Name DataNavigateUrlFields Id DataNavigateUrlFormatString Details.aspx id 0 Columns asp GridView asp SqlDataSource id srcMovieCategories ConnectionString ConnectionStrings Movies SelectCommand SELECT Id Name FROM MovieCategories Runat server div form body html From the Library of Wow eBook Using Fields with the GridView Control 535 LISTING 11.23 Details.aspx @ 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 title Details title head body form id form1 runat server div 11 asp GridView id grdMovies DataSourceID srcMovies Runat server asp SqlDataSource id srcMovies ConnectionString ConnectionStrings Movies SelectCommand SELECT Title Director FROM Movies WHERE CategoryId @CategoryId Runat server SelectParameters asp QueryStringParameter Name CategoryId QueryStringField id SelectParameters asp SqlDataSource div form body html The page in Listing 11.22 includes a GridView control that contains HyperLinkField which creates a link to the Details.aspx page and passes the movie category ID as a query string parameter. The HyperLinkField looks like this asp HyperLinkField HeaderText Movie Categories DataTextField Name From the Library of Wow eBook 536 .

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.