After you add dynamic information to a Web page, you see something like this in the document window: {rsProducts.prodID} . It gives you an idea of what the information isin this example, the database column prodID from a recordset named rsProductbut it doesn't show any real database information, which can make designing a page more difficult. You're especially far from seeing the actual result when a page contains a repeating region: what appears as a single row of dynamic text actually shows up as multiple rows or records when someone views it in a Web browser.
Fortunately, you can preview a page with real database records directly in Dreamweaver. In addition to Design view and Code view, Dreamweaver includes a view for working with dynamic information: Live Data view. When viewing a dynamic page in Live Data view, Dreamweaver contacts the testing server, retrieves recordset data from the database, and displays it in the document window, as shown in Figure 21-15.
To turn the Live Data view on or off, click the Live Data View button on the toolbar, choose View Live Data, or press Ctrl+Shift+R ( -Shift-R). It may take a few seconds for the document window to change, since Dreamweaver must contact the testing server and retrieve information from the database. After a moment, the Live Data toolbar appears (see Figure 21-15), complete with tools for refreshing the displayed data, changing settings for the Live Data view, and adding URL parameters to test recordset filters.
With the Live Data view turned on, it's much easier to see what your page looks like when viewed on the Web. You can continue to work on a Web page in this view just as you would in Design view. You can add text and graphics, modify page properties, and even format dynamic data, as described on Section 21.2.1.
However, when you're working with a repeating region, you can only select, delete, or format the first set of dynamic data items. For instance, as you can see in Figure 21-15, a dynamic table displays repeating rows of database records. If you wanted to apply a Cascading Style Sheet style to the name of each product listed, you would click the item in the first row of dynamic datain this example, "Crop Ovals and Other Lesser-Known Alien Visitations"and apply the style to it. To see the style applied to the other records, click the Refresh button in the Live Data View toolbar.
Some recordsets depend on information provided by a form or URL. Often when you use the filter option, for instance, a recordset searches a database for records that match information from a form or URL.
This feature can come in handy for pages that provide detailed information about a single record. Frequently, for these types of pages, the URL might appear something like this: details.asp?prodID=38 , where the name of the page ( details.asp )is followed by a URL parameter that includes a name ( prodID ) and value ( 38 ). The recordset then looks for the product whose ID ( prodID ) matches 38.
Because pages like this can't show up properly without a little outside help, you need to provide extra information in the Live Data View Setting window, like this:
In the Live Data toolbar, click the Settings button (see Figure 21-15) .
You can also choose View Live Data Settings. Either way, the Live Data Settings window appears (Figure 21-16).
Click the Name column and type a name for the new "URL request" item .
If the "URL request" is being used to filter data in a recordset, you would use the name you used when you created the filter in the Recordset window (see step 5 on Section 21.1.4).
Click the Value column and type a value .
This may be a number or text, but the value must retrieve at least one record from the database, according to the filter options you set up in the recordset. For example, if you created a filter to find products under a certain price, you might type price as the name of the URL request and 10 as its value.
From the Method menu, select either GET or POST .
If the filter in your recordset uses a form variable, select POST; if the filter uses a URL parameter, select GET.
Click OK to close the Live Data Setting window .
If you haven't turned on the Auto Refresh button, you must click the Refresh button in the Live Data toolbar (see Figure 21-15) to see the new results. In addition, if you selected the GET method in step 5, a URL Parameter box appears in the Live Data toolbar. You can change the values of the URL parameter directly in this box.