Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Advertising Control AdRotator for ASP.NET

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use ASP.NET advertising control AdRotator, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

AdRotator.aspx, create an AdRotator server control in the ASP.NET page and connect the advertisement XML file to this control. Use the following server control tags to complete

The copy code is as follows:

Generate the code for the advertisement

The copy code is as follows:

AdRotator.aspx.cs

Using System

Using System.Collections.Generic

Using System.Linq

Using System.Web

Using System.Web.UI

Using System.Web.UI.WebControls

Public partial class myTest_advertisement: System.Web.UI.Page

{

Protected void Page_Load (object sender, EventArgs e)

{

}

Protected void ad_Created (object sender, AdCreatedEventArgs e)

{

If ((string) e.AdProperties ["Animal"]! = ")

Label1.Text = (string) e.AdProperties ["Aniaml"]

Else

Label1.Text = "N.A."

}

}

Xml document format

The copy code is as follows:

Picture path (local)

Picture connection

A prompt when the mouse is up

Keyword

Priority

Picture path (local)

Picture connection

A prompt when the mouse is up

Keyword

Priority

Picture path (local)

Picture connection

A prompt when the mouse is up

Keyword

Priority

Note xml

AdvertisementFile: XML containing advertising information

BorderColor: set the border color for ads, such as BorderColor= "# 000000" to set the border to black

BorderWidth: boundary width in pixels, such as BorderWidth= "1"

CssClass: font classes from CSS files or inline STYLE elements, such as CssClass= "clsAds"

Height: the height of an advertising image in pixels

KeywordFilter: filter advertising categories, as seen in the example above

Target: the target window of the URL when clicking on the advertisement. Such as Target= "_ new", a new window is created every time the ad image is clicked. "_ top" is the default value

Width: the width of an advertising image in pixels

The KeywordFilter property of the AdRotator control can filter advertisements for a particular category.

The above is all the content of the article "how to use the Advertising Control AdRotator by ASP.NET". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report