Server behavior techniques
This section covers the common and advanced techniques that create and edit server
behaviors. Most of the suggestions involve specific settings in the EDML files.
Finding server behaviors
Writing search patterns
way for Dreamweaver to find each instance in a document. This requires a
and at least one
searchPattern
The
tag should be a string, not a regular expression, that indicates that the
quickSearch
server behavior might exist on the page. It is not case-sensitive. It should be short and unique,
and it should avoid spaces and other sections that can be changed by the user. The following
example shows a participant that consists of the simple ASP JavaScript tag:
<% if (Recordset1.EOF) Response.Redirect("some_url_here") %>
In the following example, the
<quickSearch>Response.Redirect</quickSearch>
For performance reasons, the
server behavior instances. If this string is found in the document and the participant identifies
a server behavior (in the group file,
server behavior files are loaded and the
participant has no reliable strings for which to search (or for debugging purposes), you can
leave the
quickSearch
<quickSearch></quickSearch>
In this example, the server behavior is always loaded and can search the document.
Next, the
searchPattern
tag and extracts parameter values from the participant code. The search patterns specify where
to search (the
whereToSearch
specific patterns. These patterns can use simple strings or regular expressions. The previous
example code is an ASP directive, so the
regular expression identifies the directive and extracts the parameters, as shown in the
following example:
<quickSearch>Response.Write</quickSearch>
<searchPatterns whereToSearch="directive">
<searchPattern paramNames="rs,new__url">
/if\s*\((\w+)\.EOF\)\s*Response\.Redirect\("([^\r\n]*)"\)/i
</searchPattern>
</searchPatterns>
In order to update or delete server behaviors, you must provide a
tag, which is contained within the
string checks for that tag:
quickSearch
pattern is the beginning of the process of finding
quickSearch
partType="identifier"
findServerBehaviors()
string empty, as shown in the following example:
tag searches the document more precisely than the
attribute) with a series of
whereToSearch="directive"
quickSearch
searchPatterns
for this participant), the related
function is called. If your
tags that contain
searchPattern
specification and a
Server behavior techniques
tag
tag.
quickSearch
369
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers