Specifications

Chapter 14186
If you add the server behavior again with a different name, such as "bbb", the document now
looks like this:
<% //test_p1 name="aaa" %>
<% //test_p2 name="aaa" %>
<% //test_p1 name="bbb" %>
<% //test_p2 name="bbb" %>
<html>
There are two instances of Test listed in the Server Behaviors panel. If the user tries to add a third
instance to the page and names it "
aaa", nothing is added because it already exists.
Within the <html> tag, matching can also use position information. In the following example,
there are two participants, one that is added before the selection and another that is added after
the selection:
<% if (expression) { //mySBName %>
Random HTML selection here
<% } //end mySBName %>
These are two participants without parameters, so they are grouped together. However, you
can add another instance of this server behavior elsewhere in the HTML, as shown in the
following example:
<% if (expression) { //mySBName %>
Random HTML selection here
<% } //end mySBName %>
More HTML here...
<% if (expression) { //mySBName %>
Another HTML selection here
<% } //end mySBName %>
Now there are two identical instances of each participant, which is allowed within the HTML.
They are matched by the order in which they occur in the document.
The following example shows a matching problem and how to avoid it. You can create a
participant that computes the tax on some dynamic data and displays the result at the selection.
<% total = Recordset1.Fields.Item("itemPrice").Value * 1.0825 %>
<html>
<body>
The total (with taxes) is $<%=total%>
</body>
</html>
The two participants are matched because they have no common parameters. However, if you
add a second instance of this server behavior, you should have the following code:
<% total = Recordset1.Fields.Item("itemPrice").Value * 1.0825 %>
<% total = Recordset1.Fields.Item("salePrice").Value * 1.0825 %>
<html>
<body>
The total (with taxes) is $<%=total%>
Sale price (with taxes) is $<%=total%>
</body>
</html>