100 likes | 226 Views
Code Reuse with Server Behaviors Tom Muck co-author Building Dreamweaver 4 and Dreamweaver UltraDev 4 Extensions Dreamweaver MX: The Complete Reference Dreamweaver UltraDev 4: The Complete Reference. Snippets are “static” Snippets have two modes: insert and wrap Snippets are easy to use .
E N D
Code Reuse with Server Behaviors Tom Muck co-author Building Dreamweaver 4 and Dreamweaver UltraDev 4 Extensions Dreamweaver MX: The Complete Reference Dreamweaver UltraDev 4: The Complete Reference http://www.dwteam.com/
Snippets are “static” Snippets have two modes: insert and wrap Snippets are easy to use SBs are “dynamic” SBs can contain multiple blocks of code Server behaviors are easy to use Snippets vs. Server Behaviors http://www.dwteam.com/
The Dreamweaver Extensibility Model • Objects • Behaviors • Commands • Server Behaviors • Data Sources • Toolbars http://www.dwteam.com/
Server Behaviors • Used to insert code that needs to be processed at the Server • Important to the integration of custom code into the Dreamweaver environment • Supported for all of the Dreamweaver Server Models • ASP, PHP, CF, JSP, ASP.NET • Can include one or more models http://www.dwteam.com/
Constructing Server Behaviors • Assemble working code • Build the Server Behavior • Hand Coding • The Server Behavior Builder • Test the Server Behavior • Package and Distribute the Server Behavior http://www.dwteam.com/
The Server Behavior Builder • Designed to simplify the addition of custom Server Behaviors • Requires that you know two things • The final code needed to do the job • Where the code needs to go • Handles the construction of the various functions within a Server Behavior • Has significantly increased the number of available behaviors http://www.dwteam.com/
Response.Redirect Server Behavior • Assemble the working code • Construct the Server Behavior • Touring the Server Behavior Builder • Testing the Server Behavior • Packaging and Distributing the Server Behavior • MXI files • MXP files • The Dreamweaver Exchange http://www.dwteam.com/
A Conditional Region Server Behavior • More complex code • Requires multiple code blocks • Can be applied to a variety of objects • Can be built to check for a number of conditions http://www.dwteam.com/
Alternate colored rows extension • Dedicated conditional region • Based on variables that Repeat Region generates http://www.dwteam.com/
Alternate CSS extension • Uses a CSS class instead of bgcolor • Dedicated conditional region • Based on variables that Repeat Region generates http://www.dwteam.com/