Sideway
output.to from Sideway




Draft for Information Only

Content

ASP Server Components
  Content Rotator component
    File Name
    Syntax
    Parameters
    Remark
   ContRot.ChooseContent Method
    Syntax
    Parameters
    Return Values
   ContRot.GetAllContent Method
    Syntax
    Parameters
    Return Values
   Content Schedule File
    Syntax
    Parameters
   Examples

ASP Server Components

Some of the ASP server components are the common features found in dynamic web pages. These base ASP server components are provided to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages. However, some IIS pre-made components are not installed for all version of IIS. Ad Rotator, Browser Capabilities, Content Linker, Content Rotator, Counters, Logging Utility, My Info, Page Counter, Status, and tools are not installed with IIS 6.0. However, if you upgrade your Web server from a previous version of IIS, the pre-made components are not removed. Some IIS pre-made components, ASP content rotator and nextlink,  are deprecated in IIS7. And most IIS pre-made components are either not installed with IIS7 or their usage is not supported.

Content Rotator component

The Content Rotator component can be used to create a ContentRotator object that acts as a HTML tags holder on an ASP page for controlling the rotation of HTML content strings to be displayed on a web page automatically. The function of the ContentRotator object is to automate the displaying of HTML content strings on the web page each time when an user opens or reloads the web page. A text file called Content Schedule File is used to store the information for controlling the way of the  HTML content strings to be displaced on the web page. Since the HTML content strings can be texts or HTML tags, any type of content can be displayed by the ContentRotator object through HTML tags, e.g. text, images, or hyperlinks, even style control. Therefore a ContentRotator object can be used to rotate the content of a web page through a list of content items, hyperlinks, or style properties each time when the web page is opened or reloaded by the user.

In addition to the Content Schedule file, the Content Rotator Component uses a random generator to select which of the weighted content strings is displayed, therefore a HTML content string may be repeated especially when there is only a few entries in the Content Schedule file, or one of the entries in the Content Schedule file is weighted much higher than the others.

File Name

The file name of the Content Rotator component is Controt.dll.

Syntax

Set ContRotName = Server.CreateObject( "MSWC.ContentRotator" )

Parameters

ContRotName

The parameter "ContRotName" is the name assigned to the instance of the ContentRotator object created by the call using the Server.CreateObject.

Remark

The Content Rotator component does not work with Internet Information Server 7 (IIS7).

ContRot.ChooseContent Method

ContRot.ChooseContent method is used to retrieve the HTML content string from the Content Linking List file and response the HTML content string on the current ASP page. The script "ContRot.ChooseContent" runs each time when a user opens or reload the page, and the ContRot.ChooseContent method will retrieve a new random scheduled HTML content string each time.

Syntax

ContRotName.ChooseContent( content-schedule-path )

Parameters

ContRotName

The parameter "ContRotName" is the name of the instance of the ContentRotator object to be set.

content-schedule-path

The parameter "content-schedule-path" is used to specify the location of the Content Schedule file. The path parameter can be specified by either using a relative or virtual path. The ContentRotator object will call the Server.MapPath method to map the specified path to the physical directory of the Content Schedule file.

Return Values

The ContRot.ChooseContent method returns an HTML content string from the Content Schedule file.

ContRot.GetAllContent Method

ContRot.GetAllContent method is used to retrieve all of the HTML content strings from the Content Linking List file and response all HTML content strings on the current ASP page as a list with an <HR> tag after each entry. The script "ContRot.GetAllContent" is usually used to proofread all the HTML content strings in the Content Schedule file.

Syntax

ContRotName.ChooseGetAllContent( content-schedule-path )

Parameters

ContRotName

The parameter "ContRotName" is the name of the instance of the ContentRotator object to be set.

content-schedule-path

The parameter "content-schedule-path" is used to specify the location of the Content Schedule file. The path parameter can be specified by either using a relative or virtual path. The ContentRotator object will call the Server.MapPath method to map the specified path to the physical directory of the Content Schedule file.

Return Values

The ContRot.ChooseContent method returns all HTML content strings from the Content Schedule file and a HTML tag <HR> is added between two entries before strings are responsed to the ASP web page.

Content Schedule File

The Content Schedule File is used to store the specification details of the display schedule and scheduled entries of HTML content string in a collection for the Content Rotator component. There can be any number of HTML content string entries in the file. Each entry is divided into two parts. The first part is lines that begins with double percentage sings (%%) and is used for specifying the optional parameters, relative weight and comments. The second part is the HTML content string. Each line ends in a carriage return.

The Content Linking List File should be stored under the web server directory so that the Content Linking List File can be accessed through a virtual path. For the optional parameters in the first part,  a hash (#) character at the beginning of wording is used as the indicator of an weighting item while double slash (//) characters at the beginning of wording is used as the indicator of an comments item.

The change in a Content Linking List File may need to restart the IIS services in ordered to make the changes become effective.

Syntax

((%% [#Weight] [//comments])+
ContentString)+

Parameters

[...]

The parameter "[" & "]" is the indicator of the bracketed parameters by a pair of square brackets "[...]" is an optional item unless other specified.

(...)+

The parameter "+" is the indicator of the bracketed property parameters by a pair of brackets "(...)" can be repeated one or more times.

Weight

The optional parameter "Weight" is used to specify the individual relative weight of the HTML content string entry. Although a number between 0 and 10000 can be used for indicating the individual relative weight of the banner image, there is a limitation that the sum of the Weights for all entries cannot exceed 10000, otherwise an error will be generated when the Content Schedule file is called by the GetAllContent or ChooseContent method. The number 10000 is only the maximum total number of Weights for all entries in the collection. The weighting mechanism for the probability of display is expressed as the ratio of the individual weight of an item over the total number of Weights for all items in the Content Schedule file. For example, if a Content Schedule file contains three entries with weights set to 1, 3, and 4, the first content is displayed 12.5 percent of the time, the second 37.5 percent of the time, and the third 50 percent of the time. if the Weight is not specified, a default value 1 is assigned to the content. But a Weight of 0 will cause the entry of the content to be ignored by the ContentRotator object.

comments

The optional parameter "comment" is used to specify the comments about the content entry. The comment is for reference only and will not be displayed to the user. Multi-line comment is supported by repeating a line begins with the double percentage sings (%%) line delimiter and followed by the double slash (//) of a comment indicator

ContentString

The parameter "ContentString" is used to specify the HTML content string to be displayed by  ContentRotator object. The HTML content string can be used to present text, image, or hyperlink, ...etc. Multi-line ContentString is supported. More than one lines of HTML content string can be entered because the ContentRotator object treats all lines between two line blocks with double percent signs (%%) as one single HTML content string entry. 

Examples

  • Example of making use of ContentRotator object to display HTML content string in a web page.

    ASP Page, Nextlink.asp:

    <%
    Set cr = Server.CreateObject("MSWC.ContentRotator")
    %>
    Displace one scheduled content:<br />
    <%
    Response.Write cr.ChooseContent("ContRotSch.txt")
    %><br /><br />
    Displace the whole list of scheduled content:<br />
    <%
    Response.Write cr.GetAllContent("ContRotSch.txt")
    %>

    HTTP response ouput:
    Displace one scheduled content:<br />
    <img src="../images/sideway.jpg" />
     <br /><br />
    Displace the whole list of scheduled content:<br />
     
    <hr>
     
    Output.to Sideway.
     
    <hr>
     
    <h1>Heading 1</h1>
     
    <hr>
     
    <img src="../images/sideway.jpg" />
     
    <hr>
     
    Here's the <a href="output.to">Home Page</a>.
    <hr>
  • Example of Content Schedule File

    Text in the Content Schedule File, ContRotSch.txt:

    %% // Using the default value 1 for the Weight.
    Output.to Sideway.
     
    %% #2 // line 1 comment.
    %% // line 2 comment.
    <h1>Heading 1</h1>

    %% #3 // This is the Sideway image.
    <img src="../images/sideway.jpg" />
     
    %%
    Here's the <a href="http://output.to">Home Page</a>.


©sideway
close

References

  1. Active Server Pages, http://msdn.microsoft.com/en-us/library/aa286483.aspx, updated 20Dec2012
  2. ASP Overview, http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx, updated 21Dec2012
  3. ASP Best Practices, http://technet.microsoft.com/en-us/library/cc939157.aspx, updated 15Apr2013
  4. ASP Built-in Objects, http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx, updated 20Dec2012
  5. Response Object, http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx, updated 20Dec2012
  6. Request Object, http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx, updated 20Dec2012
  7. Server Object (IIS), http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx, updated 20Dec2012
  8. Application Object (IIS), http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx, updated 20Dec2012
  9. Session Object (IIS), http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx, updated 20Dec2012
  10. ASPError Object, http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx, updated 20Dec2012
  11. ObjectContext Object (IIS), http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx, updated 20Dec2012
  12. Debugging Global.asa Files, http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx, updated 15Apr2013
  13. How to: Debug Global.asa files, http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx, updated 15Apr2013
  14. Calling COM Components from ASP Pages, http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx, updated 15Apr2013
  15. IIS ASP Scripting Reference, http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx, updated 15Apr2013
  16. ASP Keywords, http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx, updated 15Apr2013
  17. Creating Simple ASP Pages, http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx, updated 15Apr2013
  18. Including Files in ASP Applications, http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx, updated 15Apr2013
  19. ASP Overview, http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx, updated 15Apr2013
  20. FileSystemObject Object, http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx, updated 14Mayr2013
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx, ADO Object Model, updated 15Apr2013
  22. ADO Fundamentals, http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx, updated 14Mayr2013
close

ID: 130200007 Last Updated: 2013/2/14 Revision: 0 Ref:

IMAGE

Home (5)

Business

Management

HBR (3)

Information

Recreation

Hobbies (7)

Culture

Chinese (1097)

English (336)

Reference (66)

Computer

Hardware (149)

Software

Application (187)

Digitization (24)

Numeric (19)

Programming

Web (648)new

CSS (SC)

ASP.NET (SC)

Regular Expression (SC)

HTML

Knowledge Base

Common Color (SC)

Html Entity (Unicode) (SC)

Html 401 Special (SC)

OS (389)

MS Windows

Windows10 (SC)

.NET Framework (SC)

DeskTop (7)

Knowledge

Mathematics

Formulas (8)

Number Theory (206)

Algebra (20)

Trigonometry (18)

Geometry (18)

Calculus (67)

Complex Analysis (21)

Engineering

Tables (8)

Mechanical

Mechanics (1)

Rigid Bodies

Statics (92)

Dynamics (37)

Fluid (5)

Fluid Kinematics (5)

Control

Process Control (1)

Acoustics (19)

FiniteElement (2)

Biology (1)

Geography (1)


Copyright © 2000-2019 Sideway . All rights reserved Disclaimers last modified on 10 Feb 2019