Technical Training
ASP.NET 2.0Table of Contents
ASP.NET Displaying Master-Detail Data on the Same Page
ASP.NET Displaying Master-Detail Data on the Same Page - Page 2ASP.NET Displaying Master-Detail Data on the Same Page Page - 2
ASP.NET Displaying Master-Detail Data on the Same Page
To configure a query to display related records
1. Press ENTER to make space underneath the SqlDataSource1 control.
2. From the Data group of the Toolbox, drag a DetailsView control onto the page.
3. Configure it to use a second data source control using the following steps:
.......a. From the Choose Data Source list, select < New Data Source >.
.......b. Select Database.
.......c. Click OK.
.......d. In the Choose a data connection list, click the connection you created and stored
.......earlier in the walkthrough.
.......e. Click Next.
.......f. From the Name list under Table or View Options, select StudentMaster.
.......g. In the Columns box, check StudentId, StudentName and CourseId.
.......h. Click WHERE.
.......The Add WHERE Clause dialog box is displayed:
.......i. From the Column list, select CourseId
.......j. From the Operator list, select =.
.......k. From the Source list, select Control.
.......Under Parameter Properties, in the Control ID list, select GridView1. The query for the
.......second grid will get its parameter value from the selection in the first grid.
.......l. Click Add and then click OK to close the Add WHERE Clause dialog box.
.......m. Click Next.
.......n. In the Preview page, click Test Query.
.......The wizard displays a dialog box that prompts you for a value to use in the WHERE clause.
.......o. Type 22 in the box and click OK.
4. The Student records for CourseId 22 are displayed.

5. Click Finish.
6. In the Common DetailsView Tasks menu, check Enable Paging.

7. This will allow the user scroll through individual Student records.
8. Optionally, in the Properties window, open the PagerSettings node and select a different Mode value.

9. By default, you page through records by clicking a page number, but the user can select options to use next and previous links.
10. The page can now be tested.
To test the page
1. Press CTRL+F5 to run the page.
2. In the grid, select a category.
3. The DetailsView control displays a Student record associated with that CourseId.
4. Use the pager links in the DetailsView control to navigate to other student records for the same courseId.
5. In the grid, select a different CourseId.

6. Review the Student records for that CourseId in the DetailsView control.
ASP.NET 2.0
- Getting started with ASP.NET 2.0
- .NET Framework Fundamentals
- Microsoft.NET Framework Tools
- Application Development in .NET
- What's New in the .NET Framework 2.0 ?
- Introduction to Visual Studio.NET
- Installing Visual Studio.NET 2005
- Working with Visual Studio.NET Web Applications
- Whats New in ASP.NET 2.0
- Creating an ASP.NET Application
- ASP.NET Code Directory
- ASP.NET Page Object Model
- ASP.NET Server Controls
- ASP.NET Working With Master Pages
- ASP.NET Creating Content for Master Page
- ASP.NET Referencing Master Page Members
- ASP.NET Changing Master Pages Dynamically
- ASP.NET Creating Nested Master Pages
- ASP.NET Working with Web Parts
- ASP.NET Using Web Parts and Controls in Web Pages
- ASP.NET Web Pages and Layout
- ASP.NET - Adding Web Parts at Run Time
- ASP.NET Personalization: User Profiles and Themes
- ASP.NET Data Access features
- ASP.NET State Management
- ASP.NET Customizing the Session State Mechanism
- ASP.NET State Management And Caching
- ASP.NET Security
- Forms Authentication in ASP.NET
- ASP.NET Managing Membership and Roles
- ASP.NET Configuring Page-Level Caching
- ASP.NET Setting Application-Level Caching
- ASP.NET Data Source Object Model
- ASP.NET SqlDataSource Control
- ASP.NET Data Bound Controls
- ASP.NET GridView Control
- ASP.NET GridView Filtering
- ASP.NET Adding Sorting and Paging in GridView
- ASP.NET DataBound Controls - Details View
- ASP.NET Using a Grid to Display Detail Information
- ASP.NET Displaying Master-Detail Data on the Same Page
- Displaying Master-Detail Data on Separate Pages in ASP.NET
- ASP.NET Creating Web Wizards
- ASP.NET : Dynamic Image control
- ASP.NET Advanced Site Functionality







