Dreamweaver Create Master and Detail Pages Part 1 of 2
This is the first part of tutorial on creating Master and Detail pages, using Dreamweaver. Today, we will first create the master page, which is a page containing a summary of records in a database table, including links, which when clicked will go to a detail page, which shows details of a given record.
1. Create two new files, called master.asp and detail.asp
2. Double-click master.asp in the site panel, to open master.asp
3. Insert table to contain the dynamic fields, eg. 2 rows, 3 columns, two columns to show username and firstname, and another column to contain link to detail page
4. Select Bindings tab (under Applications panel)
5. Click + sign, and select Recordset (Query)
6. Enter recordset name of rsShowUsers
7. Select Connection, eg. connTest (should have already been created, see post on dreamweaver database setup)
8. Select table, eg. test.user
9. click Selected option, and select fields of userid, username, and firstname
note: userid field is also selected, as its value needs to be passed to detail page
10. click OK
11. Enter headings for the field values for username and firstname, and also enter text of Edit in the second row, third column, as this text will be later made into a link to detail page, and drag and drop dynamic fields to appropriate cell in second row.
12. Select text of Edit, right-click on selection, and select Make Link, and select detail page, eg. detail.asp
13. Select one of the dynamic fields, eg. firstname, in dynamic view, and then copy the corresponding asp code in the code view
note: the copied code to show value of recordset called rsShowUsers for firstname field is:
<%=(rsShowUsers.Fields.Item(”firstname”).Value)%>
14. Edit this value, to allow it to show value of recordset called rsShowUsers for userid field instead:
<%=(rsShowUsers.Fields.Item(”userid”).Value)%>
15. Select linked text of Edit, and add change the link in Link value of property inspector
from:
detail.asp
to:
detail.asp?userid=<%=(rsShowUsers.Fields.Item(”userid”).Value)%>
note: this actually adds a url parameter called userid, which will be set to the value of the userid field for the recordset called rsShowUsers, and this url parameter will be sent to detail.asp
16. Select row containing dynamic fields of username and firstname and the link
17. Select Server Behaviors tab, under Application panel
18. Click + sign, and select Repeat Region
19. Select All records, and click OK

Comments »
No comments yet.
RSS feed for comments on this post.