Name
ChooseContent —
objContentRotator
.ChooseContent(
strContentSchedFile)
Synopsis
Selects an HTML snippet from the content schedule file. The snippet chosen by the Content Rotator component is selected from all the other snippets in the schedule file according to that snippet's weight relative to the other snippets. When you call the ChooseContent method, the component calls the MapPath method of the Server object to determine the physical path for the virtual path you pass as an argument to ChooseContent. The result of this method call is a small HTML snippet that can be placed in the HTML sent to the client.
Parameters
-
strContentSchedFile A string value representing the virtual or relative pathname and filename of your content schedule file. You cannot use physical paths or absolute URLs (those beginning with http://, //, or \\) for this parameter.
Example
<HTML>
<HEAD>
<TITLE>Document List</TITLE>
<BODY>
<%
' Dimension local variables.
Dim objContentRotr
Dim strSelHTMLContent
' Create an instance of the Content Rotator object.
Set objContentRotr = _
Server.CreateObject("MSWC.ContentRotator")
' Retrieve a quotation from the Quote content schedule
' file for December.
strSelHTMLContent = objContentRotr.ChooseContent( _
"/SchedFiles/DecemberQuotes.txt")
' Now you can add the content thus retrieved to the
' HTML sent to the client.
%>
Today's quote:<BR>
<%= strSelHTMLContent %>
. . . [additional HTML and code]Notes
Obviously, the more snippets of HTML code you add to the content schedule ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access