WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Content Rotator Component (ASP 3.0)


ASP Content Rotator Component

The ASP Content Rotator segment makes a ContentRotator object that shows a diverse substance string each time a guest enters or invigorates a page.

A content document, called the Content Schedule File, incorporates the data about the substance strings.

The content strings can contain HTML labels so you can show any sort of substance that HTML can speak to: content, pictures, hues, or hyperlinks.

Syntax

<%
Set cr=Server.CreateObject("MSWC.ContentRotator")
%>

ASP Content Rotator Example

The following model shows an alternate substance each time a guest sees the Web page.

First, make a content document named "textads.txt" and place it in a subfolder called "text".

"textads.txt":

%% #3
<h2>This is an incredible day!!</h2>

%% #3
<img src="smiley.gif">

%% #4
<a href="http://www.welookups.com">Visit welookups.com</a>

Notice the #number toward the start of each substance string. This number is a discretionary parameter that shows the overall load of the HTML content string. In the content record over, the Content Rotator will show the first and second substance string three-tenth of the time, and the third string four-tenths of the time.

Then, make an ASP document, and addition the accompanying code:

Example

<html>
<body>
<%
set cr=server.createobject("MSWC.ContentRotator")
response.write(cr.ChooseContent("text/textads.txt"))
%>
</body>
</html>


ASP Content Rotator Component's Methods

Method Description Example
ChooseContent Gets and presentations a substance string <%
diminish cr
Set cr=Server.CreateObject("MSWC.ContentRotator")
response.write(cr.ChooseContent("text/textads.txt"))
%>

Output:

Smiley

GetAllContent Retrieves and shows the majority of the substance strings in the content file <%
diminish cr
Set cr=Server.CreateObject("MSWC.ContentRotator")
response.write(cr.GetAllContent("text/textads.txt"))
%>

Output:

This is an incredible day!!

Smiley

Visit welookups.com