TAILIEUCHUNG - ASP.NET 4 Unleased - p 46

Using the SqlDataSource Control ” Runat=”server” The SqlDataSource control in Listing includes a QueryStringParameter. The QueryStringParameter supplies the movie ID in the SqlDataSource control’s SelectCommand. Using the SessionParameter Object The SessionParameter object enables you to represent any item stored in Session state. The SessionParameter object includes all the properties of the base Parameter class and the following property: . SessionField—The | 424 CHAPTER 9 Using the SqlDataSource Control asp DetailsView id dtlMovie DataSourceID srcMovie Runat server asp HyperLink Runat server Text Back. NavigateUrl asp SqlDataSource id srcMovie SelectCommand SELECT FROM Movies WHERE Id @Id ConnectionString ConnectionStrings Movies Runat server SelectParameters asp QueryStringParameter Name Id QueryStringField Id SelectParameters asp SqlDataSource div form body html The SqlDataSource control in Listing includes a QueryStringParameter. The QueryStringParameter supplies the movie ID in the SqlDataSource control s SelectCommand. Using the SessionParameter Object The SessionParameter object enables you to represent any item stored in Session state. The SessionParameter object includes all the properties of the base Parameter class and the following property SessionField The name of the item stored in Session state that the SessionParameter represents. NOTE Session state is discussed in detail in Chapter 28. From the Library of Wow eBook Using Parameters with the SqlDataSource Control 425 The page in Listing contains a GridView that displays a list of movies matching a movie category. The movie category is stored in Session state. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML EN http TR xhtml11 DTD script runat server void Page_Load Session MovieCategoryName Animation script html xmlns http 1999 xhtml head id Head1 runat server title Show SessionParameter title head body form id form1 runat server div asp GridView id grdMovies DataSourceID srcMovies Runat server asp SqlDataSource id srcMovies SelectCommand SELECT Name As Category Title Director FROM Movies INNER JOIN MovieCategories ON CategoryId WHERE Name @Name ConnectionString ConnectionStrings Movies Runat server SelectParameters asp SessionParameter Name Name SessionField MovieCategoryName SelectParameters asp .

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.