Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Examples: ASP Counters Component Get Method

Display the value of a counter with:

<%= Counters.Get(CounterName) %>

Assign the value of the counter to a variable with:

<% countervar = Counters.Get(CounterName) %>

The following script displays the vote tally from a poll about favorite colors.

<% 
 If colornumber = "1" Then 
  Counters.Increment("greencounter") 
 Else 
  If colornumber = "2" Then 
   Counters.Increment("bluecounter") 
  Else 
   If colornumber = "0" Then 
    Counters.Increment("redcounter") 
   End If 
  End If 
 End If 
%>
<P>Current vote tally:
<P>red: <% = Counters.Get("redcounter") %>
<P>green: <% = Counters.Get("greencounter") %> 
<P>blue: <% = Counters.Get("bluecounter") %>


ContentsPreviousNextIndex