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 .