Create an ad link using the XML language of the ASP.--asp.net

Source: Internet
Author: User

1. All properties of the AdRotator ad control are optional, and the XML file can contain the attributes shown in the following table (the AD attributes of the XML file).
 
Property Description
ImageUrl The URL of the image to display
NavigateUrl Web page URL to go to when you click the AdRotator control
AlternateText The real question pump when the image is not available
Keyword Ad categories that you can use to filter specific ads
Impressions Numeric value indicating how often the advertisement may appear (weighted value)

2, DEMO01.APSX:
1 <%@ PageLanguage= "C #"AutoEventWireup= "true"CodeFile= "Demo01.aspx.cs"Inherits= "Demo01" %>2 <!DOCTYPE HTML>3 <HTMLxmlns= "http://www.w3.org/1999/xhtml">4 <Headrunat= "Server">5 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"/>6     <title></title>7 </Head>8 <Body>9     <formID= "Form1"runat= "Server">Ten     <Divstyle= "Text-align:center"> One         <Asp:adrotatorID= "AdRotator1"runat= "Server"AdvertisementFile= "~/demo01xmlfile.xml" /> A     </Div> -     </form> - </Body> the </HTML>
3, Demo01xmlfile.xml:
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Advertisements>3   <Ad>4     <IMAGEURL>Images/01.jpg</IMAGEURL>5     <NAVIGATEURL>http://www.cnblogs.com/qikeyishu/</NAVIGATEURL>6     <AlternateText>Link to Geek Art blog</AlternateText>7     <Keyword>Cnblog, blog</Keyword>8     <Impression>80</Impression>9   </Ad>Ten   <Ad> One     <IMAGEURL>Images/02.jpg</IMAGEURL> A     <NAVIGATEURL>http://www.cnblogs.com/qikeyishu/</NAVIGATEURL> -     <AlternateText>Link to Geek Art blog</AlternateText> -     <Keyword>Cnblog, blog</Keyword> the     <Impression>80</Impression> -   </Ad> - </Advertisements>
Effect Picture:

source file Download: Demoxml.zip

Create an ad link using the XML language of the ASP.--asp.net

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.