Browse DevX
Sign up for e-mail newsletters from DevX


Use Dreamweaver MX Server Behaviors to Automate Dynamic Data Operations : Page 2

Dreamweaver MX makes creating data-driven Web sites easy enough for even Web development novices.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

How to Add a Server Behavior
Figure 1: Choose a behavior to add it to the current page.
After opening an ASP page and creating a recordset, you're ready to start adding behaviors. To do so, click the plus (+) symbol in the Server Behaviors tab in the Application panel. Then, choose a behavior from the resulting submenu (see Figure 1). After you choose a behavior, Dreamweaver MX inserts one or more code blocks, known as participants, into your page, and adds the new behavior, by name, to the Server Behaviors tab. You can select the name in the Server Behaviors tab to quickly locate the behavior. We selected a Repeat Region behavior in the current page (see Figure 2) that displays employees (FirstName and LastName fields) from the Northwind Employees table.

Perhaps the biggest obstacle you'll face is deciding exactly where to have Dreamweaver MX insert the new block of code for the behavior. Unfortunately, there's no general guideline you can follow. The key lies in knowing what the script does and what text, statement, or object that script acts upon. Usually, you'll select the corresponding text, statement, or object before inserting the script. On the bright side, positioning doesn't always matter—some behaviors execute successfully regardless of where you put them, as long as they're within the body of the page. The list of server behaviors in the Server Behaviors sidebar includes general comments about positioning.

Figure 2: Select a behavior to highlight its corresponding code.
Be careful when modifying your page. If you manually alter a participant (a single ASP tag) in any way, even just to delete or add a space or line break, Dreamweaver MX will no longer display the behavior in the Server Behaviors tab. The participant will still exist in the page and it will still work. However, you won't be able to access it quickly anymore—you'll have to find it yourself by viewing the script.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date