Exforsys.com
 
Home Tutorials ASP.NET 2.0
 

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

 

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

Page 1 of 2


ASP.NET 2.0 Tutorials

Displaying Master-Detail Data on Separate Pages

In this tutorial you will learn how to display Master-Detail Data on Separate Pages, create the details page, test the pages and Allow Editing, Deleting, and Inserting Using a DetailsView DataBound control.



A variation of the GridView and DetailsView control is the display on separate pages. Each record has an hyperlink which enables them to navigate to a second page where they can view the detail records in a DetailsView control


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


2. Switch to Design view.


3. Type Courses 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 Connect to Data Source list choose < New Data Source > and then use the wizard to do the following:


a. Click Database.


b. Connect to the ExForSys database.


c. Retrieve the CourseId, CourseName and CourseDuration columns from the CourseDetails table.


6. Optionally, in the smart tag panel select the Enable paging check box.


7. In the smart tag panel, choose Edit Columns.


8. The Fields dialog box is displayed.


9. Clear the Auto-Generate Fields check box.



10. Under Available Fields, choose HyperLink Field, click Add, and then set the following properties:


Property

Value


Text

Details

DataNavigateUrlFields


CourseId

This indicates that the hyperlink should get its value from the CourseId column


DataNavigateUrlFormatString


DetailsCourse.aspx?CourseId={0}

This creates a link that is hard-coded to navigate to the DetailsCourse.aspx page. The link also passes a query string variable named CourseId whose value will be filled using the column referenced in the DataNavigateUrlField property.


 


Click OK to close the Fields dialog box.


The details page can now be created that accepts a value from the master page. It should look like the screenshot here:




 


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


Read Next: ASP.NET 2.0 Creating Web Wizards



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape