If you have any suggestions or comments, and would prefer using email, please contact me at:
gngabriel29[REMOVETHISANDREPLACEWITHYOU-KNOW-WHAT]ymail.com

October 14, 2008

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

Change recordset settings for master page

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

Drag and drop dynamic fields to appropriate cells

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.

Select Make Link

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)%>

Edit asp code to show value of userid field

14. Edit this value, to allow it to show value of recordset called rsShowUsers for userid field instead:

<%=(rsShowUsers.Fields.Item(”userid”).Value)%>

Edit link to pass userid parameter to detail page

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

Select Repeat Region

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.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>. I unfortunately do not have a spoiler-code, so be sure mark spoilers well.



Anti-spam measure: please retype the above text into the box provided.