Display multiple recordset results, Modify repeating regions in the property inspector – Adobe Dreamweaver CC 2015 User Manual
Page 595
588
Dynamic sites, pages and web forms
Last updated 6/3/2015
Display and hide regions based on recordset results
You can also specify that a region be displayed or hidden based on whether the recordset is empty. If a recordset is
empty (for example, no records were found matching the query), you can display a message informing the user that no
records were returned. This is especially useful when creating search pages that rely on user input search terms to run
queries against. Similarly, you can display an error message if there is a problem connecting to a database, or if a user’s
user name and password do not match those recognized by the server.
The Show Region server behaviors are:
• Show If Recordset Is Empty
• Show If Recordset Is Not Empty
• Show If First Page
• Show If Not First Page
• Show If Last Page
• Show If Not Last Page
1
In Design view, select the region on the page to show or hide.
2
In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button.
3
Select Show Region from the pop-up menu, select one of the listed server behaviors, and click OK.
Display multiple recordset results
The Repeating Region server behavior lets you display multiple records from a recordset within a page. Any dynamic
data selection can be turned into a repeating region. However, the most common regions are a table, a table row, or a
series of table rows.
1
In Design view, select a region that contains dynamic content.
The selection can be anything, including a table, a table row, or even a paragraph of text.
To select a region on the page precisely, you can use the tag selector on the left corner of the document window. For
example, if the region is a table row, click inside the row on the page, then click the rightmost
selector to select the table row.
2
Select Window > Server Behaviors to display the Server Behaviors panel.
3
Click the Plus (+) button, and select Repeating Region.
4
Select the name of the recordset to use from the pop-up menu.
5
Select the number of records to display per page, and click OK.
In the Document window, a thin, tabbed, gray outline appears around the repeating region.
Modify repeating regions in the Property inspector
❖
Modify the selected repeating region by changing any of the following options:
• The name of the repeating region.
• The recordset providing the records for the repeating region.
• The number of records displayed
When you select a new option, Dreamweaver updates the page.