[This is preliminary documentation and subject to change]

## ChooseContent

The ChooseContent method retrieves an HTML content string from the Content Schedule File and displays it on the current page. The method retrieves a new content string each time the script is run, such as when a user opens or reloads a page.

###### Syntax

ContRot.ChooseContent( content-schedule-path)

###### Parameters

content-schedule-path
  Specifies the location of the Content Schedule file.

  This parameter can be specified either as a relative or virtual path. For example, if the Content Schedule file, ContRot.txt, and the .asp file that called ChooseContent both resided in the directory /MyApp/Data/, where MyApp is a virtual directory on the server, then either the full virtual path (/MyApp/Data/ContRot.txt) or the relative path (ContRot.txt) could be specified for content-schedule-path.

  The Content Rotator Component calls the Server.MapPath method to map the specified path to a physical directory. For more information, see the Server Object reference pages.

###### Return Value

Returns an HTML content string from the Content Schedule file.

Note Because the Content Rotator Component uses a random generator to select which of the weighted content strings is displayed, a string may be repeated. This is most likely to occur if there are few entries in the Content Schedule file, or if one entry is weighted much higher than the others.

###### Example

The following example gets a new tip from the ContRot.txt file in the /Data/ virtual directory.

--- ContRot.asp ---

    <%
      Set objContRot = Server.CreateObject("MSWC.ContentRotator")
    %>
    <%= objContRot.ChooseContent("/Data/ContRot.txt") %>

© 1997-2001 Microsoft Corporation. All rights reserved.