Exforsys

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality

Ads


Home arrow Technical Training arrow ASP.NET 2.0

ASP.NET Displaying Master-Detail Data on the Same Page Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 13th Sep 2005    |   Last Updated on: 15th Nov 2010

ASP.NET Displaying Master-Detail Data on the Same Page

Ads

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.

Ads

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.



 
This tutorial is part of a ASP.NET 2.0 tutorial series. Read it from the beginning and learn yourself.

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality
 

Comments