Hãy có một cái nhìn chi tiết hơn ở một dịch vụ Web. Chúng tôi cũng sẽ bắt đầu khám phá khả năng sử dụng cho các dịch vụ Web. Bạn có thể định nghĩa một dịch vụ Web bằng cách chỉ đơn giản là viết một vài dòng mã và đặt chúng vào trong một tập tin có phần mở rộng asmx | Exercise Solutions string connectionstring ConnectionString dbConnection new connectionString string queryString SELECT Players . PlayerName Positions . PositionName Teams . TeamName FROM Players Positions PlayerTeam Teams WHERE PlayerTeam . PlayerID Players . PlayerID AND PlayerTeam . Position Positions . PositionID AND PlayerTeam . TeamID Teams . TeamID AND Players . PlayerID @PlayerID dbCommand new queryString dbConnection dbParam_teamID new @PlayerID playerID dbParam_teamID dataReader return dataReader The GetTeamsByPlayer method is a very simple alteration of GetPlayersByTeam from the Teams page. The really tricky part on this page is that we need to obtain the ID of the player that the user selects. In the Team page that was easy - we packaged up each team s ID as the CommandArgument for the LinkButton in the teams DataList. But a DataGrid won t let us do that so we need to find another solution. Remember the fields we set up on the players DataGrid At the left hand side there was an invisible column that contained the player ID. This is how we get it TableCell cell TableCell 0 int SelectedPlayerID Chapter 11 This chapter deals with tracking users across pages and looks at the objects that are used to enable this feature. Exercise 1 Add some text Current Topic and a Label control to the page above the main chat box which contains the text of the current topic stored in the Application object . Add some default topic 693 Appendix A .