Lesson 3: Use ad Rotator)

Source: Internet
Author: User

Lesson 3: Use ad Rotator)
Parts

The Internet web section is usually provided as an example. To make the festival interesting, and to show the advertisements of several customers in a limited space, you may also want to see different announcements through the loop. The ad rotator component simplifies the display of each advertising task in order, and makes the addition of new advertising work easier. In addition, you can easily add or upgrade the ultra-level link, this user can access the web site of the user through the single-click advertisement. In this lesson, you will create a script, and use the ad rotator component to switch four on-demand selections. Single-click bottom? Show me )? Click the button to display a notification, and then click the button again to switch to another notification.

----------

Create an announcement

We have created a web page for a virtual business called? Bayshore travel ?, You will insert an advertisement wheel for the script in this page. In this document, you can create a simple document to inform the ad rota tor Group of the advertisements to be inserted and ratio of minutes to minutes. We have created a wide-ranging file for you. To check it, use the text editor to open the tutorial directory (C: \ winnt \ HELP \ IIS \ HTM \ tutorial) on the localhost web server). The script file (redirect. asp) set in the first line of the file will be called when the user clicks the advertisement. Redirect through repair. ASP file, which can be executed before the link is connected to the Web node of the client, it is better than tracking the progress that is welcomed. The three rows below define the width, height, and edge frame of the advertising image.

Redirect/IISHelp/IIS/htm/tutorial/redirect. asp

& Gt; width 180

The height is 180.

Border 1

Next, the text package contains the widely reported data. For each advertisement, the image used and the Redirection URL are included (redirect is called here. ASP). graph image description text to show the ratio of hundreds of points:

/IISHelp/IIS/htm/tutorial/nyc.jpg

Http://www.microsoft.com

Big deals in the Big Apple

35

By maintaining the notification information in the separated files, you can update the adrot.txt files in different groups in a single location, instead of updating ASP pages. Different small groups can be used to provide different comments for different parts in the maintenance node.

Create a script

Open the Bayshore. asp file in the tutorial file (C: \ winnt \ HELP \ I is \ HTM \ tutorial) on the localhost web server with the text editor.

In the opening of Bayshore. asp files, paste the following script before any HTML mark or ASP sentence:

<%@ Language = "VBScript" %> 〉

This script is an ASP command. It tells the web server that your script is compiled using VBScript. This refers to the first line of the ASP document. Search for text? Tutorial lesson: Ad rotator .?, Your script will be inserted after this line.

Create an ad rotator group instance, and then assign the value to the variable ad. Copy the following script and paste it to the text editor (the text line found in the previous step ):

<% Set ad = server. Createobject ("mswc. adrotator") %> 〉

Assign the value of a group of parts to a variable, which can be used in the subsequent script.

If, before this, another user has completed the teaching process, then this script has been saved. Please use a reset script to cover the existing script, or the unused Bayshore. ASP retries the template contents (C: \ winnt \ HELP \ IIS \ HTM \ tutorial \ template) to the tutorial contents.

To display new advertisements, use the getadvertisement method of the AD rotator component. Add the following command to your script:

<%= Ad. getadvertisement ("adrot2.txt") %> 〉

The getadvertisement method requires a parameter, which is the name of the file containing the message. This name may be different from adrot.txt, where it is adrot2.txt. Based on the number of parameters, this method returns a fully formatted HTML tag, which contains an appropriate advertisement. The variable name that you assigned to the ad rotator group is before ad, followed by the getadvertisement method, and the last is the document path ADR ot2.txt. The equal sign sends the value returned by the method to the browser of the user.

Save the file Bayshore. asp in plain text format, and then exit the file editor. Note: The part suffix. A sp does not need to be replaced by the text editor.

To verify whether the ASP page you created is normal, export your browser to http: // localhost/IISHelp/IIS/help/htm/tutorial/Bayshore. ASP. (If you want to return back to this tutorial, you only need to click it in the browser? Last page? Or? Back? You can press the button. )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.