To create a parameter that lets the user supply the necessary value:
Enclose the
1
formParam
<% Session("lang_pref") = Request.Form("@@formParam@@"); %>
Create a dialog box that prompts the designer to supply the name of the form object. For
2
more information, see
Making code blocks conditional
Dreamweaver lets you develop code blocks that incorporate control statements that execute
conditionally. The Server Behavior Builder uses
contain server behavior parameters. This enables you to insert alternate text blocks based on the
values of OR relationships among server behavior parameters. The
statements appear as shown below. Note that square brackets ([ ]) denote optional code, and the
asterisk (*) denotes zero or more instances:
<@ if (expression1) @>
conditional text1
[<@ elseif (expression2) @>
conditional text2]*
[<@ else @>
conditional text3]
<@ endif @>
Condition expressions can be any JavaScript expression that can be evaluated using the JavaScript
function, and may include a server behavior parameter marked by @@'s. (The @@'s are
eval()
necessary to distinguish the parameter from JavaScript variables and keywords.)
You can nest any number of conditionals or a loop directive (see
on page
594) within a conditional directive. For example, you can specify that if an expression is
true to execute a loop.
Note: New lines after each "@>" are ignored.
Related topics
•
"About code blocks" on page 590
Effectively using conditional expressions
When using
,
if
text is preprocessed to resolve the
result. The
and
if
expression is the same as that for JavaScript condition expressions, and can also contain server
behavior parameters. Directives such as this allow you to choose between alternative code blocks
based on the values of, or relationships between, server behavior parameters.
For example, the JSP code shown below comes from a Dreamweaver MX server behavior that uses
the conditional code block:
@@rsName@@.close();
<conditional_code>
@@rsName@@_hasData = @@rsName@@.next();
If the server behavior uses a normal recordset, the
with:
@@rsName@@ = Statement@@rsName@@.executeQuery();
string in parameter markers:
"Creating a dialog box for a custom server behavior" on page
, and
directives within the
else
elseif
directives and to determine which text to include in the
if
directives take the expression as an argument. The condition
elseif
,
, and
if
elseif
else
if
"Repeating code blocks"
insertText
<conditional_code>
About custom server behaviors
603.
statements, and may also
,
, and
elseif
else
XML tag, the participant
placeholder is replaced
593
Need help?
Do you have a question about the DREAMWEAVER MX 2004-USING DREAMWEAVER and is the answer not in the manual?
Questions and answers