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

Displaying Master-Detail Data on Separate Pages in ASP.NET Page - 2

Page 2 of 2
Author : Exforsys Inc.     Published on: 16th Sep 2005    |   Last Updated on: 16th Feb 2007

Displaying Master-Detail Data on Separate Pages in ASP.NET

Ads

To create the details page

1. Add a new page to the Web site and name it DetailsCourse.aspx.

2. Switch to Design view.

3. Type Students in the page and format the text as a heading.

4. From the Data folder of the Toolbox, drag a GridView control onto the page.

5. In the smart tag panel, from the Choose Data Source list choose < New Data Source >.

6. In the Select a data source type list, click Database and then click OK.

7. From the Choose a data connection list, select the connection you created and stored earlier.

8. Click Next.

9. The wizard displays a page where you can create a SQL statement.

10. From the Name list under Table or View Options, select CourseDetails.

11. In the Columns box, check StudentId, StudentName and CourseId.

12. Click WHERE.

13. From the Columns list, select CourseId.

14. From the Operators list, select =.

15. From the Source list, select QueryString.

16. This specifies that the query will select records based on the value passed into the page with the query string.

17. Under Parameter Properties, in the QueryString field box, type CourseId.

18. The query will get the CourseId value from the query string, which is created when you click a Details link in the MasterCourses.aspx page.

19. Click Add.

20. Click OK to close the Add WHERE Clause dialog box.

21. Click Next, and then click Finish to close the wizard.

22. From the Standard node of the Toolbox, drag a Hyperlink control onto the page. Set its Text property to Return to Courses and its NavigateUrl property to MasterCourses.aspx.

The Master-details pages can now be tested. The DetailsCourses.aspx design screen should look as under.

To test the pages

1. Switch to the MasterCourses.aspx page.

2. Press CTRL+F5 to run the page.

3. Click the Details link for a coursedetails.

4. The browser displays the DetailsCourse.aspx page with course for the selected courseid. Note that the URL in the browser's Address box is: DetailsCourses.aspx?CourseId=xxx. Where xxx is the ID of the course selected.

5. Click the Return to courses link, select a different course, and click the Details link again to test that you can view courses for any student.

Ads

Allowing Editing, Deleting, and Inserting Using a DetailsView Control

1. Right-click the DetailsView control and then click Show Smart Tag.

2. On the Common DetailsView Tasks menu, select Enable Inserting, Enable Editing, and Enable Deleting boxes.

In this section of the tutorial we have explored the DetailsView control and used it in combination with the GridView to view data from different tables on the same page or on different pages. The potentiality of use is limited only to the imagination of the user.

In the next section of this tutorial we shall be examining the FormsView control in detail.



 
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